From 3e449f806186f587897b5026684aea894a66ac3a Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Mon, 3 Nov 2014 10:49:05 +0000 Subject: [PATCH] re PR c++/57820 ([DR 253] NSDMI and const objects) 2014-11-03 Paolo Carlini PR c++/57820 * g++.dg/cpp0x/constexpr-ctor16.C: New. * g++.dg/cpp0x/constexpr-ctor17.C: Likewise. From-SVN: r217035 --- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/g++.dg/cpp0x/constexpr-ctor16.C | 11 +++++++++++ gcc/testsuite/g++.dg/cpp0x/constexpr-ctor17.C | 13 +++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/constexpr-ctor16.C create mode 100644 gcc/testsuite/g++.dg/cpp0x/constexpr-ctor17.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7e97d61..480e139 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2014-11-03 Paolo Carlini + + PR c++/57820 + * g++.dg/cpp0x/constexpr-ctor16.C: New. + * g++.dg/cpp0x/constexpr-ctor17.C: Likewise. + 2014-11-03 Marc Glisse PR tree-optimization/60770 diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor16.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor16.C new file mode 100644 index 0000000..12aaeeb --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor16.C @@ -0,0 +1,11 @@ +// PR c++/57820 +// { dg-do compile { target c++11 } } + +struct C +{ + int a = 2; + int b = a + 1; +}; + +C c; +constexpr C d = {}; diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor17.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor17.C new file mode 100644 index 0000000..ed82a14 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor17.C @@ -0,0 +1,13 @@ +// PR c++/57820 +// { dg-do compile { target c++11 } } + +struct C +{ + int a = 2; + int b = a + 1; + + constexpr C() {} +}; + +C c; +constexpr C d; -- 2.7.4