annotate gcc/testsuite/g++.dg/template/typedef20.C @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
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++/40007
kono
parents:
diff changeset
3 // { dg-do compile }
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 class x
kono
parents:
diff changeset
6 {
kono
parents:
diff changeset
7 typedef int privtype; // { dg-message "private" }
kono
parents:
diff changeset
8
kono
parents:
diff changeset
9 protected:
kono
parents:
diff changeset
10 typedef int type;
kono
parents:
diff changeset
11 };
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 template<typename T>
kono
parents:
diff changeset
14 struct y : public x
kono
parents:
diff changeset
15 {
kono
parents:
diff changeset
16 typename x::type z;
kono
parents:
diff changeset
17 };
kono
parents:
diff changeset
18
kono
parents:
diff changeset
19 template<typename T>
kono
parents:
diff changeset
20 struct y<T*> : public x
kono
parents:
diff changeset
21 {
kono
parents:
diff changeset
22 typedef x::type good;
kono
parents:
diff changeset
23 typedef x::privtype bad; // { dg-error "within this context" }
kono
parents:
diff changeset
24 };
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 template class y<int>;
kono
parents:
diff changeset
27 template class y<int*>;