From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AE2813858412; Sat, 2 Mar 2024 00:39:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AE2813858412 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709339947; bh=W11veTGl5LwfNhW+jgDJGhNNXseKY2KuoYCgub/s4nA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=oLMPV3GQbama/CU0iU7MPEJ0qRqGbcIPcUbEPwmtU55O3x69XozU2TOvHwkWU2cjW mbF/Eh9AFu2wHG60IsiwSGnvU5V3F+uV0Y4+Nx9FO4UmS+W40lsbKmYKQRp7bXZ6Vv 0Q7afMtLN7g/PBrr8o6vn2IcT1PEdrRNem0PaNcA= From: "cvs-commit 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: Sat, 02 Mar 2024 00:39:05 +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: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub 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 #29 from GCC Commits --- The releases/gcc-13 branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:051cd2a3ee9ba9f47d640a10e96c79b6c5124736 commit r13-8392-g051cd2a3ee9ba9f47d640a10e96c79b6c5124736 Author: Jakub Jelinek Date: Thu Feb 22 19:32:02 2024 +0100 c: Handle scoped attributes in __has*attribute and scoped attribute par= sing changes in -std=3Dc11 etc. modes [PR114007] We aren't able to parse __has_attribute (vendor::attr) (and __has_c_attribute and __has_cpp_attribute) in strict C < C23 modes. While in -std=3Dgnu*= modes or in -std=3Dc23 there is CPP_SCOPE token, in -std=3Dc* (except for -st= d=3Dc23) there are is just a pair of CPP_COLON tokens. The c-lex.cc hunk adds support for that, but always returns 0 in that c= ase unlike the GCC 14+ version. 2024-02-22 Jakub Jelinek PR c/114007 gcc/c-family/ * c-lex.cc (c_common_has_attribute): Parse 2 CPP_COLONs with the first one with COLON_SCOPE flag the same as CPP_SCOPE but ensure 0 is returned then. gcc/testsuite/ * gcc.dg/c23-attr-syntax-8.c: New test. libcpp/ * include/cpplib.h (COLON_SCOPE): Define to PURE_ZERO. * lex.cc (_cpp_lex_direct): When lexing CPP_COLON with another colon after it, if !CPP_OPTION (pfile, scope) set COLON_SCOPE flag on the first CPP_COLON token. (cherry picked from commit 37127ed975e09813eaa2d1cf1062055fce45dd16)=