From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A6CC73858D28; Mon, 15 Jan 2024 23:38:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A6CC73858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705361929; bh=uy9ofiJCE64fFOuFwlN38SJqyqGabDQcr6RCAcekDkM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Zb8Ghdp46N7/eLzMrFHiHNZegGJWEej7gghcTNBSD6y15Zzc2hxzS+/bRm8VuFOTk w2JWILWgS6qg3cuvnKJ5v4uCJRfN2JULC/cwuip2mi10MpRI2/fZMznTzz6njUx0Or sC7O3imgIxL/eexr0nQSxP5ax6czLHKkTeFE5i60= From: "mpolacek at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/113360] [13/14 Regression] Truncated constexpr error messages with -std=c++23/26 Date: Mon, 15 Jan 2024 23:38:49 +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: unknown X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: mpolacek at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.3 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=3D113360 --- Comment #1 from Marek Polacek --- The "deducing from brace-enclosed initializer" error is emitted during pars= ing from listify. The body of init_list is not potentially-constant (due to erroneous FOR_COND), so we register_constexpr_fundef it with result =3D=3D error_mark_node. require_rvalue_constant_expression in finish_static_assert thinks init_list= is potentially-constant, so we call cxx_constant_value. new_call.fundef->resu= lt is error_mark_node so we don't bother evaluating the body. We call explain_invalid_constexpr_fn but that has nothing to say, so we end up with= a missing reason. But we already said what went wrong, so we shouldn't repeat it here anyway. The body is: { int total =3D 0; <>; { int x =3D <<< error >>>; <<< error >>> __for_range; <<< error >>> __for_begin; <<< error >>> __for_end; <<< Unknown tree: for_stmt <<< error >>> <<< error >>> <>>;>>; <(x)) >>>>>; >>>; } return =3D VIEW_CONVERT_EXPR(total) =3D=3D 6; } Can be reproduced in C++20 with -Wno-invalid-constexpr.=