From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 92C79385AC33; Fri, 12 Jan 2024 18:07:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 92C79385AC33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705082851; bh=3J1cWq9uIQzTOEI2SK5/n7PNMyLcgBJHi+hqIQD+u7g=; h=From:To:Subject:Date:In-Reply-To:References:From; b=oz7sMlH+e7+Oz0uJBseDBq6LMjM6CyUUjKPUByZsEtjsOamYnFnHEEhQ50hjXwWpo o1SsOldekrQbfW3tn2l3QAAPSjUQJKTBdLqfuSPxZ/tX1qRWixbT4zysRSSrI+op+/ 6XyEYw4sK84LD1r5nWvTsenAd3mR27BT0fjvq088= From: "pkeir at outlook dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/111272] [13/14 Regression] Truncated error messages with -std=c++23 and -std=c++26 Date: Fri, 12 Jan 2024 18:07:28 +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: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: pkeir at outlook dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: mpolacek 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=3D111272 --- Comment #8 from Paul Keir --- I wonder if a small part of this bug still remains. The code below should #include , but as it doesn't, we get an error message. The message now gives all the right information but, with -std=3Dc++23 and -std=3Dc++26, a part of the text is still truncated. Instead of "declared h= ere" we get "is not usable as a 'constexpr' function because:". Perhaps it should also say "declared here" with -std=3Dc++23 and -std=3Dc++26. At https://godbolt.org/z/6c9hME7hh the code is: // #include constexpr bool init_list() { int total{}; for (int x : {1, 2, 3}) total +=3D x; return total =3D=3D 6; } static_assert(init_list(), ""); The error message is: : In function 'constexpr bool init_list()': :6:24: error: deducing from brace-enclosed initializer list requires '#include ' +++ |+#include 1 | // #include ...... 6 | for (int x : {1, 2, 3}) | ^ : At global scope: :11:24: error: non-constant condition for static assertion 11 | static_assert(init_list(), ""); | ~~~~~~~~~^~ :11:24: error: 'constexpr bool init_list()' called in a constant expression :3:16: note: 'constexpr bool init_list()' is not usable as a 'constexpr' function because: 3 | constexpr bool init_list() | ^~~~~~~~~ Compiler returned: 1=