]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/78645 (ICE on invalid code (Segmentation fault, cxx_eval_call_expression))
authorPaolo Carlini <paolo.carlini@oracle.com>
Thu, 21 Mar 2019 12:05:32 +0000 (12:05 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Thu, 21 Mar 2019 12:05:32 +0000 (12:05 +0000)
2019-03-21  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/78645
* g++.dg/cpp0x/constexpr-ice20.C: New.

From-SVN: r269834

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

index 12fdbd0bf90b0d4a9bda550624bad73c7670d6f1..5a343b667f1a4ffce7943cf8b80e02686fa29677 100644 (file)
@@ -1,3 +1,8 @@
+2019-03-21  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/78645
+       * g++.dg/cpp0x/constexpr-ice20.C: New.
+
 2019-03-21  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/89571
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-ice20.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-ice20.C
new file mode 100644 (file)
index 0000000..e2d4853
--- /dev/null
@@ -0,0 +1,7 @@
+// PR c++/78645
+// { dg-do compile { target c++11 } }
+
+typedef bool (*Function)(int);
+constexpr bool check(int x, Function p) { return p(x); }  // { dg-message "in .constexpr. expansion of" }
+
+static_assert(check(2, check), "");  // { dg-error "conversion|constant|in .constexpr. expansion of" }