summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/lookup/using53.C
blob: a108b50ef89d59a7d2bb903db45ac4c3210a3dd2 (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
43
44
45
46
47
48
49
50
51
52
53
// PR c++/20420

class B
{
protected:
  enum E { E1, E2, E3 };
  struct S { int i; E e; };
};

class D : private B
{
public:
  using B::E;       // { dg-message "previous" }
  using B::S;       // { dg-message "previous" }

private:
  enum E {};        // { dg-error "conflicts" }
  struct S {};      // { dg-error "conflicts" }
};

template<typename T>
class BT
{
protected:
  enum E { E1, E2, E3 };
  struct S { int i; E e; };
};

template<typename T>
class DT : private BT<T>
{
public:
  using BT<T>::E;   // { dg-message "previous" }
  using BT<T>::S;   // { dg-message "previous" }

private:
  enum E {};        // { dg-error "conflicts" }
  struct S {};      // { dg-error "conflicts" }
};

template class DT<int>;

namespace N
{
  int i;
}

void
f ()
{
  using N::i;
  using N::i;       // { dg-error "declared" }
}