OSDN Git Service

PR c++/54858
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / template / using16.C
1 // { dg-do compile }
2
3 template <class T>
4 struct A
5 {
6     typedef T type;
7 };
8
9 template <class T>
10 struct B
11 {
12     class type
13     {
14         type(); // { dg-error "private" }
15     };
16 };
17
18 template <class T>
19 struct C : A<T>, B<T>
20 {
21     using typename B<T>::type;
22
23     void f()
24     {
25         type j; // { dg-error "context" }
26     }
27 };
28
29 template class C<int>; // { dg-message "required" }
30
31 template <class T>
32 struct D
33 {
34     typedef T type;
35 };
36
37 template <class T>
38 class E : D<T>
39 {
40     using typename D<T>::type; // { dg-message "previous" }
41     using typename D<T>::type; // { dg-error "redeclaration" }
42 };