comparison gcc/testsuite/g++.dg/cpp2a/nontype-class29.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
1 // PR c++/92948 - Fix class NTTP with template arguments.
2 // { dg-do run { target c++2a } }
3
4 struct A {
5 int i;
6 constexpr A(int n) : i(n) { }
7 };
8
9 template<A a>
10 struct B {
11 static constexpr int i = a.i;
12 };
13
14 template<int X>
15 void foo()
16 {
17 B<X> b;
18 if (b.i != 42)
19 __builtin_abort ();
20 }
21
22 int
23 main ()
24 {
25 foo<42>();
26 }