summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.robertl/eb49.C
blob: c1d70a035766a9c4aee6ae35676dbfb90e1a5f05 (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
// { dg-do assemble  }

// Here we declare ::S
typedef struct s1 *S;

struct s1
{
  int s;
};

struct A
{
  // Here we declare A::S
  typedef struct s1 *S;
};

template<class T, class U> class XX;

template<class T, class U>
class X
{
public:
  static T *do_something ();
  friend class T; // { dg-error "" } `T' is a template parameter
  friend class XX<T, U>;
};

struct N
{
  // Here we declare N::S
  class S
  {
  };

  // Should use N::S and A::S.
  typedef X<S, A::S> X_S;

  void bug ();
};

void
N::bug ()
{
  // X_S is template class X<N::S, A::S>
  // `s' is N::S.
  S *s = X_S::do_something ();
}