tree: tweak warn_deprecated_use
authorJason Merrill <jason@redhat.com>
Wed, 16 Feb 2022 00:17:03 +0000 (19:17 -0500)
committerJason Merrill <jason@redhat.com>
Thu, 17 Feb 2022 22:50:59 +0000 (17:50 -0500)
commit1b71bc7c8b18bd1b22debfde155f175fd1654942
treea79add94015b8352a2fcddbc605812f382fff171
parent36100e0e952b92a6cd819620fcef851f0069ac8f
tree: tweak warn_deprecated_use

While looking at PR90451 I noticed that this function was failing to find
the attributes if called with a variant of the struct.

gcc/ChangeLog:

* tree.cc (warn_deprecated_use): Look for TYPE_STUB_DECL
on TYPE_MAIN_VARIANT.

gcc/testsuite/ChangeLog:

* g++.dg/warn/deprecated-16.C: New test.
gcc/testsuite/g++.dg/warn/deprecated-16.C [new file with mode: 0644]
gcc/tree.cc