re PR c++/70156 (incorrect "incomplete type" error initializing a static const data...
authorMarek Polacek <polacek@redhat.com>
Tue, 14 May 2019 21:10:58 +0000 (21:10 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Tue, 14 May 2019 21:10:58 +0000 (21:10 +0000)
PR c++/70156
* g++.dg/init/static5.C: New test.

From-SVN: r271192

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/init/static5.C [new file with mode: 0644]

index caa0de956ff6f6690ac485c8e59a18ebb97b5b22..3dfe6b0550d81efa6923dd586dc168dcfe192221 100644 (file)
@@ -1,3 +1,8 @@
+2019-05-14  Marek Polacek  <polacek@redhat.com>
+
+       PR c++/70156
+       * g++.dg/init/static5.C: New test.
+
 2019-05-14  Iain Sandoe  <iain@sandoe.co.uk>
 
        PR target/82920
diff --git a/gcc/testsuite/g++.dg/init/static5.C b/gcc/testsuite/g++.dg/init/static5.C
new file mode 100644 (file)
index 0000000..4eaf787
--- /dev/null
@@ -0,0 +1,9 @@
+// PR c++/70156
+// { dg-do compile { target c++11 } }
+
+template <int> struct A { int i; };
+struct B { int i; };
+struct C {
+    static const A<0> a = { 0 }; // { dg-error ".constexpr. needed for in-class initialization of static data member" }
+    static const B b = { 1 }; // { dg-error ".constexpr. needed for in-class initialization of static data member" }
+};