summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/template/access11.C
blob: c9364a823999b9b2dd77967947213c170c928f26 (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
// Copyright (C) 2003 Free Software Foundation
// Contributed by Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
// { dg-do compile }

// Access checking during explicit instantiation.

class A {
  typedef int X;		// { dg-error "private" }
};

class X {
  private:
  template <typename T> struct Y;
};

template <> struct X::Y<int> {
  A::X x;			// { dg-error "this context" }
};

template <typename T> struct X::Y {
  typename T::X x;		// { dg-error "this context" }
};

template struct X::Y<A>;	// { dg-message "instantiated from here" }