annotate gcc/testsuite/g++.dg/template/typedef25.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // Contributed by Dodji Seketeli <dodji@redhat.com>
kono
parents:
diff changeset
2 // Origin PR c++/42225
kono
parents:
diff changeset
3 // { dg-do compile { target c++11 } }
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 template<class T>
kono
parents:
diff changeset
6 struct A
kono
parents:
diff changeset
7 {
kono
parents:
diff changeset
8 typedef T I;
kono
parents:
diff changeset
9 static const char *i;
kono
parents:
diff changeset
10 };
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 template<class T, int>
kono
parents:
diff changeset
13 struct B
kono
parents:
diff changeset
14 {
kono
parents:
diff changeset
15 typedef T TT;
kono
parents:
diff changeset
16 typedef decltype(TT::i) TT_I0;
kono
parents:
diff changeset
17 typedef decltype(&TT::i) TT_I1;
kono
parents:
diff changeset
18 typedef decltype(*TT::i) TT_I2;
kono
parents:
diff changeset
19 typedef A<TT_I0> TA0;
kono
parents:
diff changeset
20 typedef A<TT_I1> TA1;
kono
parents:
diff changeset
21 typedef A<TT_I2> TA2;
kono
parents:
diff changeset
22 };
kono
parents:
diff changeset
23
kono
parents:
diff changeset
24 template<class T>
kono
parents:
diff changeset
25 void
kono
parents:
diff changeset
26 foo()
kono
parents:
diff changeset
27 {
kono
parents:
diff changeset
28 typedef T TT;
kono
parents:
diff changeset
29 typedef decltype(TT::i) TT_I0;
kono
parents:
diff changeset
30 typedef decltype(&TT::i) TT_I1;
kono
parents:
diff changeset
31 typedef decltype(*TT::i) TT_I2;
kono
parents:
diff changeset
32 typedef A<TT_I0> TA0;
kono
parents:
diff changeset
33 typedef A<TT_I1> TA1;
kono
parents:
diff changeset
34 typedef A<TT_I2> TA2;
kono
parents:
diff changeset
35 }
kono
parents:
diff changeset
36
kono
parents:
diff changeset
37 int
kono
parents:
diff changeset
38 main()
kono
parents:
diff changeset
39 {
kono
parents:
diff changeset
40 foo<A<int> >();
kono
parents:
diff changeset
41 }
kono
parents:
diff changeset
42