view gcc/testsuite/g++.dg/template/qualified-id3.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

// PR c++/44587

template <const int N> struct A { };
template <class T> struct B {
  static const int c; // { dg-message "not initialized with a constant expression" }
  typedef A<B<T>::c> C;	// { dg-error "constant expression|template argument" }
};
template <class T> const int B<T>::c = sizeof (T);

template <const int N> struct D { };
template <class T> struct E {
  static const int c = sizeof (T);
  typedef D<E<T>::c> F;		// OK
};