From 1d7dcb0ed2f9077727fc45c7d694a865fa974ff6 Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Tue, 14 May 2019 21:10:58 +0000 Subject: [PATCH] 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 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/init/static5.C | 9 +++++++++ 2 files changed, 14 insertions(+) create mode 100644 gcc/testsuite/g++.dg/init/static5.C 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" } +}; -- 2.30.2