https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113674

--- Comment #13 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Jakub Jelinek
<ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:f520f125920460d9360e2a5619b22c7ac81d35ba

commit r11-11494-gf520f125920460d9360e2a5619b22c7ac81d35ba
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Mon Feb 12 20:45:01 2024 +0100

    attribs: Don't canonicalize lookup_scoped_attribute_spec argument
[PR113674]

    The C and C++ FEs when parsing attributes already canonicalize them
    (i.e. if they start with __ and end with __ substrings, we remove those).
    lookup_attribute already verifies in gcc_assert that the first character
    of name is not an underscore, and even lookup_scoped_attribute_spec doesn't
    attempt to canonicalize the namespace it is passed.  But for some historic
    reason it was canonicalizing the name argument, which misbehaves when
    an attribute starts with ____ and ends with ____.
    I believe it is just wrong to try to canonicalize
    lookup_scope_attribute_spec name attribute, it should have been
    canonicalized already, in other spots where it is called it is already
    canonicalized before.

    2024-02-12  Jakub Jelinek  <ja...@redhat.com>

            PR c++/113674
            * attribs.c (extract_attribute_substring): Remove.
            (lookup_scoped_attribute_spec): Don't call it.

            * c-lex.c (c_common_has_attribute): Call canonicalize_attr_name.

            * c-c++-common/Wattributes-3.c: New test.

    (cherry picked from commit b42e978f29b33071addff6d7bb8bcdb11d176606)

Reply via email to