]> gcc.gnu.org Git - gcc.git/commit
c++: Fix deprecated attribute handling on templates (PR c++/93228)
authorJakub Jelinek <jakub@redhat.com>
Fri, 17 Jan 2020 14:22:22 +0000 (15:22 +0100)
committerJakub Jelinek <jakub@redhat.com>
Fri, 17 Jan 2020 14:22:22 +0000 (15:22 +0100)
commitc60a18f8056facdcf370ce0e5f51550c9df5b539
tree0b33341d57589da0a9bf0d8f477bc4f4e3f1a2f9
parentbf09d886a4be1031f7003073115af6cbc5575353
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]
This page took 0.059237 seconds and 6 git commands to generate.