https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63956

--- Comment #6 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Earlier today I tried the following and it seemed to work, but I don't know
constexpr.c, so it may be totally bogus.

--- gcc/cp/constexpr.c
+++ gcc/cp/constexpr.c
@@ -1149,6 +1149,10 @@ cxx_eval_call_expression (const constexpr_ctx *ctx, tree
t,
   constexpr_call *entry;
   bool depth_ok;

+  if (fun == NULL_TREE
+      && CALL_EXPR_IFN (t) == IFN_UBSAN_NULL)
+    return t;
+
   if (TREE_CODE (fun) != FUNCTION_DECL)
     {
       /* Might be a constexpr function pointer.  */

Reply via email to