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 12fdbd0..5a343b6 100644 (file)
@@ -1,5 +1,10 @@
 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
        * g++.dg/cpp0x/noexcept37.C: New.
 
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" }