[Bug c++/99132] [11 Regression] ICE in C++20 mode for constexpr not_null evaluation -- in cxx_eval_indirect_ref, at cp/constexpr.c:4905

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Feb 17 15:12:08 GMT 2021


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

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
We certainly can (and IMHO should) do:
--- gcc/cp/cp-gimplify.c.jj     2021-02-10 07:52:32.702901304 +0100
+++ gcc/cp/cp-gimplify.c        2021-02-17 16:06:03.045953720 +0100
@@ -1386,7 +1386,7 @@ cp_genericize_r (tree *stmt_p, int *walk
          break;
        }

-      if (tree fndecl = cp_get_callee_fndecl (stmt))
+      if (tree fndecl = cp_get_callee_fndecl_nofold (stmt))
        if (DECL_IMMEDIATE_FUNCTION_P (fndecl))
          {
            gcc_assert (source_location_current_p (fndecl));
because addresses of immediate functions shouldn't be leaking in the IL
anywhere and so only direct calls to them are possible.
The strange thing is why it ICEs only with -std=c++20...


More information about the Gcc-bugs mailing list