1 // Test for crating symbols having binding STB_GNU_UNIQUE 2 // build with g++ -fPIC -g -Wall -shared -o test6.so test6.cc 3 4 struct A 5 { 6 int i; 7 }; 8 9 struct B 10 { fooB11 int foo() 12 { 13 static A a; 14 return a.i; 15 } 16 }; 17 18 int bar()19bar() 20 { 21 B b; 22 return b.foo(); 23 } 24 25 template<typename T> 26 struct C 27 { 28 static T bar; 29 }; 30 31 template<typename T> T C<T>::bar = T(); 32 33 int bleh()34bleh() 35 { 36 C<int> c; 37 return c.bar; 38 } 39