comparison gcc/testsuite/g++.dg/template/mem-spec1.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
1 // PR c++/89744
2
3 namespace N1 {
4 template<typename> struct A
5 {
6 template<typename> struct B {};
7 A() { B<int> b; }
8 };
9
10 template<> template<typename>
11 struct A<int>::B
12 {
13 virtual void foo() {}
14 };
15
16 A<int> a;
17 }
18
19 namespace N2 {
20 template<typename> struct A
21 {
22 template<typename> struct B {};
23 A() { B<int> b; }
24 };
25
26 template<> template<typename>
27 struct A<int>::B
28 {
29 virtual void foo() {}
30 void bar() {}
31 };
32
33 A<int> a;
34 }
35
36 namespace N3 {
37 template<typename> struct A
38 {
39 template<typename> struct B {};
40 A() { B<int> b; }
41 };
42
43 template<> template<typename>
44 struct A<int>::B
45 {
46 ~B() {}
47 };
48
49 A<int> a;
50 }
51
52 #if __cpp_variadic_templates
53 namespace N4 {
54 template<typename...> struct A
55 {
56 template<typename> struct B {};
57 typedef B<int> X;
58 };
59
60 template<> template<typename>
61 struct A<int>::B
62 {
63 typedef int Y;
64 };
65
66 A<int>::B<int> b;
67 }
68 #endif