From da8006f341fc2a30d32fe7a1d9d540617ff5f8b6 Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Thu, 10 Dec 2015 15:45:49 +0000 Subject: [PATCH] re PR c++/68348 (ICE: segfault in cxx_eval_constant_expression at cp/constexpr.c:3172) PR c++/68348 * g++.dg/cpp0x/pr68348.C: New test. From-SVN: r231524 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp0x/pr68348.C | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/pr68348.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 98ecdb5f3c8..ce44fa30a9f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-12-10 Marek Polacek + + PR c++/68348 + * g++.dg/cpp0x/pr68348.C: New test. + 2015-12-10 Eric Botcazou * gnat.dg/specs/elab4.ads: New test. diff --git a/gcc/testsuite/g++.dg/cpp0x/pr68348.C b/gcc/testsuite/g++.dg/cpp0x/pr68348.C new file mode 100644 index 00000000000..9033bba23a2 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr68348.C @@ -0,0 +1,18 @@ +// PR c++/68348 +// { dg-do compile { target c++11 } } + +struct C { + constexpr C() : w(), x(), y() {} + constexpr double fn() const noexcept; + double w; + double x; + double y; +}; + +constexpr double C::fn() const noexcept { return w; } +C foo() +{ + C c; + c.fn (); + return c; +} -- 2.30.2