Debian Codegraph @

gcc/testsuite/g++.dg/abi/abi-tag3.C

raw
1 // An explicit specialization gets the tag from its template.
2
3 // { dg-final { scan-assembler "_ZN3FooB5cxx11IcE1fEv" } }
4 template<typename T>
5 struct __attribute ((abi_tag("cxx11"))) Foo
6 {
7 int f();
8 };
9
10 // { dg-final { scan-assembler "_ZN3FooB5cxx11IiE1fEv" } }
11 template<>
12 struct
13 __attribute ((abi_tag("cxx11")))
14 Foo<int> // { dg-warning "attribute" }
15 {
16 int f();
17 };
18
19 // { dg-final { scan-assembler "_ZN3FooB5cxx11IdE1fEv" } }
20 template<>
21 struct
22 Foo<double>
23 {
24 int f();
25 };
26
27 int main()
28 {
29 Foo<int> f;
30 f.f();
31 Foo<char> f1;
32 f1.f();
33 Foo<double> f2;
34 f2.f();
35 }