aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/template/friend3.C
blob: 7400534acac2413ee9cfd60c1816454759276306 (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
// { dg-do compile }

// Copyright (C) 2001 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 28 Dec 2001 <nathan@codesourcery.com>

// PR 775 friend classes with qualified names inside template classes.

struct A
{
  struct B {
    B () { }
  };
};

template <class T>
struct C: A {
  friend A::B::B (); // 2.95.2 ICE
  friend struct A;
  friend struct A::B; // 2.97 error
};

template class C<char>;

template <typename T> class TPL
{
  class nested;
};

template <typename T> class TPL<T>::nested 
{
};