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

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
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-message "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*>;