aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8.1/gcc/testsuite/g++.dg/template/typedef20.C
blob: c768ce0a78ab3b9522ff544ebd061ad97d08c07c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin PR c++/40007
// { dg-do compile }

class x
{
  typedef int privtype; // { dg-error "is private" }

protected:
  typedef int type;
};

template<typename T>
struct y : public x
{
  typename x::type z;
};

template<typename T>
struct y<T*> : public x
{
  typedef x::type good;
  typedef x::privtype bad; // { dg-error "within this context" }
};

template class y<int>;
template class y<int*>;