Commit 52af3071 by Marek Polacek Committed by Marek Polacek

re PR c++/88744 (class non-type template parameters doesn't work with default template parameters)

	PR c++/88744
	* g++.dg/cpp2a/nontype-class12.C: New test.

From-SVN: r267744
parent 416f5559
......@@ -3,6 +3,9 @@
PR c++/88538 - braced-init-list in template-argument-list.
* g++.dg/cpp2a/nontype-class11.C: New test.
PR c++/88744
* g++.dg/cpp2a/nontype-class12.C: New test.
2019-01-08 Jakub Jelinek <jakub@redhat.com>
PR target/88457
......
// PR c++/88744
// { dg-do compile { target c++2a } }
#define SA(X) static_assert((X),#X)
struct S {
int a;
int b;
constexpr S(int a_, int b_) : a{a_}, b{b_} { }
};
template<S s = {1, 2}>
struct X {
static constexpr int i = s.a;
static constexpr int j = s.b;
};
X x; // ok, X<{1, 2}>
X<{3, 4}> x2;
SA (x.i == 1);
SA (x.j == 2);
SA (x2.i == 3);
SA (x2.j == 4);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment