File: test6.cc

package info (click to toggle)
libabigail 2.6-2
  • links: PTS
  • area: main
  • in suites: trixie
  • size: 1,019,172 kB
  • sloc: xml: 572,532; cpp: 108,400; sh: 12,117; ansic: 4,199; makefile: 3,355; python: 1,672; ada: 62
file content (38 lines) | stat: -rw-r--r-- 409 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// 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;
}