summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/g++.dg/template/using16.C
blob: 589f7f18f520e259ec57eaf4abe85a22b4bf9983 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// { dg-do compile }

template <class T>
struct A
{
    typedef T type;
};

template <class T>
struct B
{
    class type
    {
	type(); // { dg-error "private" }
    };
};

template <class T>
struct C : A<T>, B<T>
{
    using typename B<T>::type;

    void f()
    {
	type j; // { dg-error "context" }
    }
};

template class C<int>; // { dg-message "required" }

template <class T>
struct D
{
    typedef T type;
};

template <class T>
class E : D<T>
{
    using typename D<T>::type; // { dg-message "previous" }
    using typename D<T>::type; // { dg-error "redeclaration" }
};
OpenPOWER on IntegriCloud