c++: [[deprecated]] on template redecl [PR84542]
commit9a65c8ee659042babdb05ef15fea9910fa8d6e62
authorPatrick Palka <ppalka@redhat.com>
Thu, 21 Dec 2023 19:33:56 +0000 (21 14:33 -0500)
committerPatrick Palka <ppalka@redhat.com>
Thu, 21 Dec 2023 19:33:56 +0000 (21 14:33 -0500)
tree240016041a781f272d059dd5b38a5cafc342d6fa
parent7226f825db049517b64442a40a6387513febb8f9
c++: [[deprecated]] on template redecl [PR84542]

The deprecated and unavailable attributes weren't working when used on
a template redeclaration ultimately because we weren't merging the
corresponding tree flags in duplicate_decls.

PR c++/84542

gcc/cp/ChangeLog:

* decl.cc (merge_attribute_bits): Merge TREE_DEPRECATED
and TREE_UNAVAILABLE.

gcc/testsuite/ChangeLog:

* g++.dg/ext/attr-deprecated-2.C: No longer XFAIL.
* g++.dg/ext/attr-unavailable-12.C: New test.
gcc/cp/decl.cc
gcc/testsuite/g++.dg/ext/attr-deprecated-2.C
gcc/testsuite/g++.dg/ext/attr-unavailable-12.C [new file with mode: 0644]