[Bug c++/79585] spurious -Wunused-variable on a pointer with attribute unused in function template

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Apr 27 21:22:01 GMT 2020


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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:5f1cd1da1a805c3d00332da45c3ab78a3931af63

commit r10-7998-g5f1cd1da1a805c3d00332da45c3ab78a3931af63
Author: Jason Merrill <jason@redhat.com>
Date:   Mon Jan 27 05:45:01 2020 -0500

    c++: Avoid ICE with dependent attribute on type.

    We previously happened to accept this testcase, but never actually did
    anything useful with the attribute.  The patch for PR86379 stopped using
    TREE_TYPE as USING_DECL_SCOPE, so 'using A::b' no longer had TREE_TYPE set,
    so the language-independent decl_attributes started crashing on it.

    GNU attributes are more flexible in their placement than C++11 attributes,
    so if we encounter a dependent GNU attribute that syntactically appertains
    to a type rather than the declaration as a whole, move it to the
    declaration; that's almost certainly what the user meant, anyway.

    gcc/cp/ChangeLog
    2020-04-27  Jason Merrill  <jason@redhat.com>

            PR c++/90750
            PR c++/79585
            * decl.c (grokdeclarator): Move dependent attribute to decl.
            * decl2.c (splice_template_attributes): No longer static.


More information about the Gcc-bugs mailing list