re PR c++/63996 (Infinite loop in invalid C++14 constexpr fn)
authorKai Tietz <ktietz@redhat.com>
Fri, 12 Dec 2014 17:17:58 +0000 (18:17 +0100)
committerKai Tietz <ktietz@gcc.gnu.org>
Fri, 12 Dec 2014 17:17:58 +0000 (18:17 +0100)
PR c++/63996
* g++.dg/cpp1y/pr63996.C: New file.

From-SVN: r218683

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

index 2c7b6159adb0d14a94c14941bc63ad1bcc2e87e3..8e5b4248528bd49bb9eb279661da6f67b4532a19 100644 (file)
@@ -1,3 +1,8 @@
+2014-12-12  Kai Tietz  <ktietz@redhat.com>
+
+       PR c++/63996
+       * g++.dg/cpp1y/pr63996.C: New file.
+
 2014-12-12  Richard Sandiford  <richard.sandiford@arm.com>
            Joseph Myers  <joseph@codesourcery.com>
 
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr63996.C b/gcc/testsuite/g++.dg/cpp1y/pr63996.C
new file mode 100644 (file)
index 0000000..c89d542
--- /dev/null
@@ -0,0 +1,10 @@
+// { dg-do compile { target c++14 } }
+
+constexpr int
+foo (int i)
+{
+  int a[i] = { };
+}
+
+constexpr int j = foo (1); // { dg-error "is not a constant expression" }
+