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

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

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

commit r12-10504-gca8ad807cf33ca9d74a2aecdd78b59af9834b882
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Tue Jan 9 15:37:04 2024 +0100

    c-family: copy attribute diagnostic fixes [PR113262]

    The copy attributes is allowed on decls as well as types and even has
    checks whether decl (set to *node) is DECL_P or TYPE_P, but for diagnostics
    unconditionally uses DECL_SOURCE_LOCATION (decl), which obviously only
works
    if it applies to a decl.

    2024-01-09  Jakub Jelinek  <ja...@redhat.com>

            PR c/113262
            * c-attribs.cc (handle_copy_attribute): Don't use
            DECL_SOURCE_LOCATION (decl) if decl is not DECL_P, use
input_location
            instead.  Formatting fixes.

            * gcc.dg/pr113262.c: New test.

    (cherry picked from commit c9fc7f398e8b330ff12ec8a29bfa058b6daf6624)

Reply via email to