view gcc/testsuite/g++.dg/template/access11.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
line wrap: on
line source

// 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-message "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 "required from here" }