From 6252e35cf5cea9a30a57ceffbc7a9f3160900a45 Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Wed, 28 Apr 2021 19:11:14 -0400 Subject: c++: Remove GCC12 FIXME for DR1312 This patch removes a FIXME I left for myself for GCC 12, along with adjusting the relevant test. gcc/cp/ChangeLog: DR 1312 * constexpr.c (cxx_eval_constant_expression): Don't check integer_zerop. gcc/testsuite/ChangeLog: DR 1312 * g++.dg/cpp0x/constexpr-cast2.C: Remove XFAILs. --- gcc/cp/constexpr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'gcc/cp/constexpr.c') diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c index 9481a5b..9cb761d 100644 --- a/gcc/cp/constexpr.c +++ b/gcc/cp/constexpr.c @@ -6745,8 +6745,7 @@ cxx_eval_constant_expression (const constexpr_ctx *ctx, tree t, /* [expr.const]: a conversion from type cv void* to a pointer-to-object type cannot be part of a core constant expression as a resolution to DR 1312. */ - if (integer_zerop (op) /* FIXME: Remove in GCC 12. */ - && TYPE_PTROB_P (type) + if (TYPE_PTROB_P (type) && TYPE_PTR_P (TREE_TYPE (op)) && VOID_TYPE_P (TREE_TYPE (TREE_TYPE (op))) /* Inside a call to std::construct_at or to -- cgit v1.1