1 // Compile with: 2 // g++ -g -Wall -fPIC -shared -o libtest31-v1.so test31-v1.cc 3 4 namespace hidden 5 { 6 7 struct S0 8 { 9 int m0; 10 char m1; 11 S0hidden::S012 S0() 13 : m0(), m1() 14 {} 15 S0hidden::S016 S0(int v) 17 : m0(v), 18 m1() 19 {} 20 }; 21 22 void foo(S0 & s)23foo(S0& s) 24 { 25 s.m0 = 2; 26 s.m1 = 1; 27 } 28 29 } // end namespace hidden 30 31 namespace visible 32 { 33 void bar(int v)34bar(int v) 35 { 36 hidden::S0 s(v); 37 hidden::foo(s); 38 } 39 40 } // end namespace visible 41