blob: c769a529cdc28d26987a3aec8fcda1b366aa029b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
// 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
};
|