]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: Fix deprecated attribute handling on templates (PR c++/93228)
authorJakub Jelinek <jakub@redhat.com>
Wed, 22 Jan 2020 16:52:11 +0000 (17:52 +0100)
committerJakub Jelinek <jakub@redhat.com>
Wed, 22 Jan 2020 19:12:56 +0000 (20:12 +0100)
commit514314b73109b3672ecb3c3c04f614bb7c7fef57
tree22518fc32177ef08e82a296e6bea8ba3c24207e3
parenta5ce64f7d50e2f5e66ceeb88c7601bd04f3b94ea
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.
gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1y/attr-deprecated-3.C [new file with mode: 0644]