aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/abi/abi-tag3.C
blob: 13cb3c2f2e91a2697b61421963a4c7a19574a97c (plain)
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
// An explicit specialization gets the tag from its template.

// { dg-final { scan-assembler "_ZN3FooB5cxx11IcE1fEv" } }
template<typename T>
struct __attribute ((abi_tag("cxx11"))) Foo
{
  int f();
};

// { dg-final { scan-assembler "_ZN3FooB5cxx11IiE1fEv" } }
template<>
struct
__attribute ((abi_tag("cxx11")))
Foo<int>			// { dg-warning "attribute" }
{
  int f();
};

// { dg-final { scan-assembler "_ZN3FooB5cxx11IdE1fEv" } }
template<>
struct
Foo<double>
{
  int f();
};

int main()
{
  Foo<int> f;
  f.f();
  Foo<char> f1;
  f1.f();
  Foo<double> f2;
  f2.f();
}