I got confused and opened this PR thinking we've got another problem here.
Turns out things work as expected with the recent patch of mine.  Well, at
least we have another testcase.

Bootstrapped/regtested on x86_64-linux, applying to trunk.

2019-01-08  Marek Polacek  <pola...@redhat.com>

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

diff --git gcc/testsuite/g++.dg/cpp2a/nontype-class12.C 
gcc/testsuite/g++.dg/cpp2a/nontype-class12.C
new file mode 100644
index 00000000000..11f8c12f3ff
--- /dev/null
+++ gcc/testsuite/g++.dg/cpp2a/nontype-class12.C
@@ -0,0 +1,23 @@
+// 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);

Reply via email to