https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85437
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- convert_ptrmem here creates a NOP_EXPR around the PTRMEM_CST, even when it is for a static cast rather than reinterpret_cast. The OFFSET_TYPEs are different, but they have the same TREE_TYPE etc. Then constexpr.c doesn't consider that cast to be usable in constant expressions and because it is called with allow_non_constant, it wraps the new PTRMEM_CST with another NOP_EXPR and that is where following constexpr.c call errors on.