re PR c++/68348 (ICE: segfault in cxx_eval_constant_expression at cp/constexpr.c...
authorMarek Polacek <polacek@redhat.com>
Thu, 10 Dec 2015 15:45:49 +0000 (15:45 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Thu, 10 Dec 2015 15:45:49 +0000 (15:45 +0000)
PR c++/68348
* g++.dg/cpp0x/pr68348.C: New test.

From-SVN: r231524

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

index 98ecdb5f3c8c74431f7b4dd03b0d524e98b5f894..ce44fa30a9f31bcdef031bc01ac93fbc850c04e4 100644 (file)
@@ -1,3 +1,8 @@
+2015-12-10  Marek Polacek  <polacek@redhat.com>
+
+       PR c++/68348
+       * g++.dg/cpp0x/pr68348.C: New test.
+
 2015-12-10  Eric Botcazou  <ebotcazou@adacore.com>
 
        * 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 (file)
index 0000000..9033bba
--- /dev/null
@@ -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;
+}