Debian Codegraph @

gcc/testsuite/g++.dg/parse/constant2.C

raw
1 // { dg-do compile }
2 // Origin: <gawrilow at math dot tu-berlin dot de>
3 // PR c++/10750: error when using a static const member initialized
4 // with a dependent expression as constant-expression
5
6 struct A
7 {
8 enum { a = 42 };
9 };
10
11 template <class Q>
12 struct B
13 {
14 static const int b = Q::a;
15 };
16
17 template <typename T, template <typename> class P>
18 struct C
19 {
20 static const bool a = T::a;
21 static const bool a_ = a;
22 static const bool b = P<T>::b;
23 static const bool b_ = b;
24 static const int c = sizeof(T);
25 static const int c_ = c;
26 };
27
28 template struct C<A,B>;