From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 07E83385840B; Wed, 21 Feb 2024 14:26:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 07E83385840B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1708525570; bh=V1wp1RyTIHyNxp+6zR/Ad2gQASHkPpQrlJxCg9CtF7w=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ueGYoO5Qc5sM4vgYgY3FpWQiO+9E4wcmMfAimCz+ooA1jsRaJ5YtajnU/LkvBKqBC q9iEQ5o5GCMneosLGg0BpAMwlW4PqvZ+oaMlr7tuSBxsyKOQQVojnKKNauD4+pbLH6 Izcnwxl8qZbq4LwuWiqCjh0YxlIiVnyLLdLCUHW4= 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: Wed, 21 Feb 2024 14:26:07 +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: NEW 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: 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 --- Comment #15 from Jakub Jelinek --- (In reply to Richard Sandiford from comment #14) > I might have misunderstood the suggestion and so be arguing against > something that no-one is suggesting, but I think [[__extension__ =E2=80= =A6]] should > accept the same things for all standard versions (C23, pre-C23, and GNU).= =20 > It was intended to be something that header files and macros could use > without needing to be sensitive to the user's choice of standard. That is still the case of [[__extension__ arm::streaming]] and similar. The only thing in the suggestion that would be only sometimes allowed would= be [[__extension__ arm: :streaming]] (or [[__extension__ arm:/**/:streaming]] etc. which I'd hope nobody is planning to use in the header files. Basically, with the flag_iso && !flag_isoc23 modes, :: is not one token but= 2, and while we in some cases could look at location info if they are adjacent= in the source, if column info isn't accurate (too long lines or too many lines) that information is lost. Or of course if you'd strongly like to accept [[__extension__ arm: :streami= ng]] in all language modes (but it won't be accepted in C++ anyway), I'd at least like to see accepting [[arm::streaming]] in the flag_iso && !flag_isoc23 mo= des (with the usual pedwarn). If we only wanted adjacent ::s and nothing in between, perhaps the preproce= ssor could set some flag on one of the CPP_COLONs (or both) if otherwise for CPP_OPTION (pfile, scope) it would be creating CPP_SCOPE, and check that fl= ag during attribute and __has*attribute parsing?=