From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A9FF5385842A; Fri, 12 Apr 2024 17:58:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A9FF5385842A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712944687; bh=nmRdy7jQvUJrU3Rh+fq9sjdxB/Np+RGbIJpRlQKcago=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Tk+Y9/SjMnRZPVcDAN6E3HVEyZgr49mFrta44wBnoM568esxF+y7wsKt22k1gxjB0 zk1wegSJjQOmnamzC7bIwLeRHATC5Ybb1zLKFNsXyRwfqT/ArpcA5vxCpmS4huatAc SiSBQAOrGCcwXjVirSG64NihvvZ/CxzNJg1fVDfY= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/114426] [14 regression] ICE when building log4cxx on arm (cxx_eval_call_expression, at cp/constexpr.cc:3242) since r14-6507 Date: Fri, 12 Apr 2024 17:58:07 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114426 --- Comment #12 from GCC Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:0fd824d717ca901319864a5eeba4e62b278f8329 commit r14-9942-g0fd824d717ca901319864a5eeba4e62b278f8329 Author: Jakub Jelinek Date: Fri Apr 12 19:57:04 2024 +0200 c++: Diagnose or avoid constexpr dtors in classes with virtual bases [PR114426] I had another look at this P1 PR today. You said in the "c++: fix in-charge parm in constexpr" mail back in December (as well as in the r14-6507 commit message): "Since a class with vbases can't have constexpr 'tors there isn't actua= lly a need for an in-charge parameter in a destructor" but the ICE is becau= se the destructor is marked implicitly constexpr. https://eel.is/c++draft/dcl.constexpr#3.2 says that a destructor of a c= lass with virtual bases is not constexpr-suitable, but we were actually implementing this just for constructors, so clearly my fault from the https://wg21.link/P0784R7 implementation. That paper clearly added that sentence in there and removed similar sentence just from the constructor case. So, the following patch makes sure the else if (CLASSTYPE_VBASECLASSES (DECL_CONTEXT (fun))) { ret =3D false; if (complain) error ("%q#T has virtual base classes", DECL_CONTEXT (fun)); } hunk is done no just for DECL_CONSTRUCTOR_P (fun), but also DECL_DESTRUCTOR_P (fun) - in that case just for cxx_dialect >=3D cxx20, as for cxx_dialect < cxx20 we already set ret =3D false; and diagnose a different error, so no need to diagnose two. 2024-04-12 Jakub Jelinek PR c++/114426 * constexpr.cc (is_valid_constexpr_fn): Return false/diagnose w= ith complain destructors in classes with virtual bases. * g++.dg/cpp2a/pr114426.C: New test. * g++.dg/cpp2a/constexpr-dtor16.C: New test.=