1 // file : tests/cxx/parser/name-clash/inheritance/driver.cxx 2 // copyright : Copyright (c) 2006-2017 Code Synthesis Tools CC 3 // license : GNU GPL v2 + exceptions; see accompanying LICENSE file 4 5 // Test for name clashes across inheritance hierarchy. 6 // 7 8 #include <string> 9 #include <iostream> 10 11 #include "test-pskel.hxx" 12 13 using namespace std; 14 using namespace test; 15 16 struct derived_pimpl: derived_pskel 17 { 18 virtual void ederived_pimpl19 e (string const& v) 20 { 21 cout << "e: " << v << endl; 22 } 23 24 virtual void e1derived_pimpl25 e1 (string const& v) 26 { 27 cout << "e1: " << v << endl; 28 } 29 }; 30 31 int main(int argc,char * argv[])32main (int argc, char* argv[]) 33 { 34 if (argc != 2) 35 { 36 cerr << "usage: " << argv[0] << " test.xml" << endl; 37 return 1; 38 } 39 40 try 41 { 42 xml_schema::string_pimpl string_p; 43 derived_pimpl derived_p; 44 45 derived_p.parsers (string_p, string_p); 46 47 xml_schema::document doc_p (derived_p, "test", "root"); 48 49 derived_p.pre (); 50 doc_p.parse (argv[1]); 51 derived_p.post_derived (); 52 } 53 catch (xml_schema::exception const& e) 54 { 55 cerr << e << endl; 56 return 1; 57 } 58 catch (std::ios_base::failure const&) 59 { 60 cerr << "io failure" << endl; 61 return 1; 62 } 63 } 64