From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4F338388EC3E; Mon, 26 Oct 2020 12:22:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4F338388EC3E From: "dimitri.gorokhovik at free dot fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/97572] [c++ 20] Constraining is broken Date: Mon, 26 Oct 2020 12:22:23 +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: 11.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: dimitri.gorokhovik at free dot fr X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2020 12:22:23 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97572 --- Comment #4 from Dimitri Gorokhovik = --- I probably cannot objectively tell anymore which one is better, since I just read the specification.=20 However, subjectively, Clang's diagnostics: a) seems to have phrasing much closer to the spec, and b) contains less misleading information: -- the champion here is GCC's "error: cannot convert =E2=80=98T=E2=80=99 to= =E2=80=98bool=E2=80=99" -- whereas 'T' *is*, in fact, 'bool'. (Note that this msg also has a status of a full error in its own right, not just a note.) -- arguably, a close contender is "error: =E2=80=98t=E2=80=99 is not a cons= tant expression". Understanding how it can happen was hard to me. 't' looks as constant as th= ey get with requires-local-parameters (I mean, constexpr-ness of a local-param= eter here should be understood as coming only from its declaration shouldn't it?= ). The (S s) form of requires-local-var is a common form, so when the compiler says 's' is not a constant expression' here, how would it be constant in ot= her situations?=