c++: Attribute deprecated/unavailable divergence
authorMarek Polacek <polacek@redhat.com>
Wed, 2 Mar 2022 15:48:26 +0000 (10:48 -0500)
committerMarek Polacek <polacek@redhat.com>
Tue, 8 Mar 2022 21:15:55 +0000 (16:15 -0500)
commit6f748bc1e7fbae876ff47e3abe477253a0e70c09
tree4e3f54eccbabfaa9f819d3137443600d6a551c76
parente3e369dad6cbecb1b490b3f3b154c600fba5a6f3
c++: Attribute deprecated/unavailable divergence

Attributes deprecated and unavailable are largely the same, except
that the former produces a warning whereas the latter produces an error.
So is_late_template_attribute should treat them the same.  Confirmed by
Iain that this divergence is not intentional:
<https://gcc.gnu.org/pipermail/gcc-patches/2022-February/591007.html>.

gcc/cp/ChangeLog:

* decl2.cc (is_late_template_attribute): Do not defer attribute
unavailable.
* pt.cc (tsubst_enum): Set TREE_UNAVAILABLE.

gcc/testsuite/ChangeLog:

* g++.dg/ext/attr-unavailable-9.C: Add dg-error.
gcc/cp/decl2.cc
gcc/cp/pt.cc
gcc/testsuite/g++.dg/ext/attr-unavailable-9.C