From: Marek Polacek Date: Tue, 14 May 2019 21:10:58 +0000 (+0000) Subject: re PR c++/70156 (incorrect "incomplete type" error initializing a static const data... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1d7dcb0ed2f9077727fc45c7d694a865fa974ff6;p=gcc.git re PR c++/70156 (incorrect "incomplete type" error initializing a static const data member) PR c++/70156 * g++.dg/init/static5.C: New test. From-SVN: r271192 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index caa0de956ff..3dfe6b0550d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-05-14 Marek Polacek + + PR c++/70156 + * g++.dg/init/static5.C: New test. + 2019-05-14 Iain Sandoe 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 index 00000000000..4eaf787d0d4 --- /dev/null +++ b/gcc/testsuite/g++.dg/init/static5.C @@ -0,0 +1,9 @@ +// PR c++/70156 +// { dg-do compile { target c++11 } } + +template 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" } +};