From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C95693858D20; Tue, 20 Feb 2024 09:17:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C95693858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1708420629; bh=1oBu8GTesQDdMxpG34SutyqrU/k1Rfr5Tc9jqFa6B0c=; h=From:To:Subject:Date:In-Reply-To:References:From; b=uOTBh8dwfNRffSh7mzwpTSJtg4BssOWgkPgwXPDTk0TmxEcgmVCbqe/kpxS09w/Xf D9JaH1tGSIsPYBIgCIEB0j0jj2cU+qVHztbyocIyZqOU0LwTPFes2H/0SjnH85UlOP ql/n0O4dWt9ciTI2MfOagD5joVqrHlpTlHAJLnOw= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug preprocessor/114007] gcc chokes on __has_cpp_attribute(clang::unsafe_buffer_usage) Date: Tue, 20 Feb 2024 09:17:09 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: preprocessor X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org 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: 14.0 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=3D114007 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org, | |jsm28 at gcc dot gnu.org --- Comment #3 from Jakub Jelinek --- Only C23 supports the [[vendor::attr]] attributes, #if __has_c_attribute (clang::unsafe_buffer_usage) int i; #endif #if __has_cpp_attribute (clang::unsafe_buffer_usage) int j; #endif compiles just fine with the default -std=3Dgnu17 or -std=3Dgnu11 or -std=3D= c23, just doesn't with -std=3Dc11. Though, guess __has_c_attribute is just an extension in C11 (and __has_cpp_attribute is a C++ macro, not C), so maybe we could as an extensi= on handle the scoped attributes in there, but not sure if it should then resul= t in 0 for anything scoped, or just if not in gnu namespace.=