Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/cpp2a/nontype-class12.C @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | |
children |
rev | line source |
---|---|
145 | 1 // PR c++/88744 |
2 // { dg-do compile { target c++2a } } | |
3 | |
4 #define SA(X) static_assert((X),#X) | |
5 | |
6 struct S { | |
7 int a; | |
8 int b; | |
9 constexpr S(int a_, int b_) : a{a_}, b{b_} { } | |
10 }; | |
11 | |
12 template<S s = {1, 2}> | |
13 struct X { | |
14 static constexpr int i = s.a; | |
15 static constexpr int j = s.b; | |
16 }; | |
17 X x; // ok, X<{1, 2}> | |
18 X<{3, 4}> x2; | |
19 | |
20 SA (x.i == 1); | |
21 SA (x.j == 2); | |
22 SA (x2.i == 3); | |
23 SA (x2.j == 4); |