You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
409 B
39 lines
409 B
4 months ago
|
// Test for crating symbols having binding STB_GNU_UNIQUE
|
||
|
// build with g++ -fPIC -g -Wall -shared -o test6.so test6.cc
|
||
|
|
||
|
struct A
|
||
|
{
|
||
|
int i;
|
||
|
};
|
||
|
|
||
|
struct B
|
||
|
{
|
||
|
int foo()
|
||
|
{
|
||
|
static A a;
|
||
|
return a.i;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
int
|
||
|
bar()
|
||
|
{
|
||
|
B b;
|
||
|
return b.foo();
|
||
|
}
|
||
|
|
||
|
template<typename T>
|
||
|
struct C
|
||
|
{
|
||
|
static T bar;
|
||
|
};
|
||
|
|
||
|
template<typename T> T C<T>::bar = T();
|
||
|
|
||
|
int
|
||
|
bleh()
|
||
|
{
|
||
|
C<int> c;
|
||
|
return c.bar;
|
||
|
}
|