view gcc/testsuite/g++.dg/template/using22.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

// PR c++/52126
// { dg-do compile }

template <class T> struct Z {};

template<typename T>
struct A
{
  struct B;
  struct C;
  struct D;
  struct E;
  struct F;
};

template <class T>
struct A<T>::B : A<T>
{
  using A::nonexist; // { dg-error "has not been declared" }
};

template <class T>
struct A<T>::C : A
{
  using A::nonexist; // { dg-error "has not been declared" }
};

template <class T>
struct A<T>::D : A<T>
{
  using A<T>::nonexist; // { dg-error "has not been declared" }
};

template <class T>
struct A<T>::E : A
{
  using A<T>::nonexist; // { dg-error "has not been declared" }
};

template <class T>
struct A<T>::F : Z<T>
{
  using Z<T>::nonexist;
};