From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 489A13858C66; Tue, 9 May 2023 13:18:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 489A13858C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683638330; bh=LxWxx4zqepofZcN+pELnw+M4hlwIPfrNAzP/ZtCBgW4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mcUl2FjOYxH/COeDSfNoB3QAWUCi9kO+zQfnmlKt30JYTlZMbE0dPvYqVWAUe9tXU P9PwLi7kTqF9qLWhJ1jWg/+Jf1iUqeVfJSM++0q72lwPN+xb+5fkOtT92LMhJMHX5g P9708PYEPycT0Oz3DoFnLx6+iNylV/O58myX/Mek= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/90302] Implement __builtin_warning Date: Tue, 09 May 2023 13:18:49 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: unknown X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: enhancement X-Bugzilla-Who: redi 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: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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=3D90302 Jonathan Wakely changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |redi at gcc dot gnu.org --- Comment #5 from Jonathan Wakely --- This would be very useful for the C++ library where we currently have precondition checks that: - abort at runtime if you compile with -D_GLIBCXX_ASSERTIONS, or - fail at compile-time if they are constexpr **and** are actually evaluated during constexpr evaluation The runtime assertions are good, but not enabled by default, and an earlier warning at compile time means the problem can be found sooner. The constexpr errors are good, but don't apply to non-constexpr calls, even= if all the arguments are known during compilation. It would be nice to be able to also issue warnings for non-constexpr calls, when compiled without -D_GLIBCXX_ASSERTIONS.=