Imported Upstream version 4.8.1
[platform/upstream/gcc48.git] / gcc / testsuite / g++.dg / abi / abi-tag3.C
1 // An explicit specialization doesn't get the tag from its template unless
2 // it is specified there, too.
3
4 // { dg-final { scan-assembler "_ZN3FooB5cxx11IcE1fEv" } }
5 template<typename T>
6 struct __attribute ((abi_tag("cxx11"))) Foo
7 {
8   int f();
9 };
10
11 // { dg-final { scan-assembler "_ZN3FooB5cxx11IiE1fEv" } }
12 template<>
13 struct
14 __attribute ((abi_tag("cxx11")))
15 Foo<int>
16 {
17   int f();
18 };
19
20 // { dg-final { scan-assembler "_ZN3FooIdE1fEv" } }
21 template<>
22 struct
23 Foo<double>
24 {
25   int f();
26 };
27
28 int main()
29 {
30   Foo<int> f;
31   f.f();
32   Foo<char> f1;
33   f1.f();
34   Foo<double> f2;
35   f2.f();
36 }