[Bug c++/93228] [[deprecated("message")]] on template struct/class drops message

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jan 22 19:20:00 GMT 2020


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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:514314b73109b3672ecb3c3c04f614bb7c7fef57

commit r9-8163-g514314b73109b3672ecb3c3c04f614bb7c7fef57
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Jan 22 17:52:11 2020 +0100

    c++: Fix deprecated attribute handling on templates (PR c++/93228)

    As the following testcase shows, when deprecated attribute is on a
template,
    we'd never print the message if any, because the attribute is not
    present on the TEMPLATE_DECL with which warn_deprecated_use is called,
    but on its DECL_TEMPLATE_RESULT or its type.

    2020-01-17  Jakub Jelinek  <jakub@redhat.com>

        PR c++/93228
        * parser.c (cp_parser_template_name): Look up deprecated attribute
        in DECL_TEMPLATE_RESULT or its type's attributes.

        * g++.dg/cpp1y/attr-deprecated-3.C: New test.


More information about the Gcc-bugs mailing list