OSDN Git Service

/cp
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / template / typedef20.C
1 // Contributed by Dodji Seketeli <dodji@redhat.com>
2 // Origin PR c++/40007
3 // { dg-do compile }
4
5 class x
6 {
7   typedef int privtype; // { dg-error "is private" }
8
9 protected:
10   typedef int type;
11 };
12
13 template<typename T>
14 struct y : public x
15 {
16   typename x::type z;
17 };
18
19 template<typename T>
20 struct y<T*> : public x
21 {
22   typedef x::type good;
23   typedef x::privtype bad; // { dg-error "within this context" }
24 };
25
26 template class y<int>;
27 template class y<int*>;