diff options
author | Jason Merrill <jason@redhat.com> | 2016-01-21 15:26:21 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2016-01-21 15:26:21 -0500 |
commit | 020491e63b0eaf2141f3ea9f65184551e94ecbad (patch) | |
tree | 566359039e775fab5642c199dc190ba14acb985d /gcc/cp | |
parent | 2f3932b910c7e450e0ac75e607dfb7229b9429cc (diff) | |
download | gcc-020491e63b0eaf2141f3ea9f65184551e94ecbad.zip gcc-020491e63b0eaf2141f3ea9f65184551e94ecbad.tar.gz gcc-020491e63b0eaf2141f3ea9f65184551e94ecbad.tar.bz2 |
re PR c++/65687 (Inconsistent behavior for __attribute__((__deprecated__)) between C and C++.)
PR c++/65687
* decl.c (type_is_deprecated): Don't look into a typedef.
From-SVN: r232703
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/decl.c | 10 |
2 files changed, 10 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c592cbf..af5c907 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2016-01-21 Jason Merrill <jason@redhat.com> + PR c++/65687 + * decl.c (type_is_deprecated): Don't look into a typedef. + PR c++/40751 PR c++/64987 * decl.c (copy_type_enum): Respect TYPE_USER_ALIGN. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 020e9bd..f4604b6 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -11595,9 +11595,13 @@ type_is_deprecated (tree type) enum tree_code code; if (TREE_DEPRECATED (type)) return type; - if (TYPE_NAME (type) - && TREE_DEPRECATED (TYPE_NAME (type))) - return type; + if (TYPE_NAME (type)) + { + if (TREE_DEPRECATED (TYPE_NAME (type))) + return type; + else + return NULL_TREE; + } /* Do warn about using typedefs to a deprecated class. */ if (OVERLOAD_TYPE_P (type) && type != TYPE_MAIN_VARIANT (type)) |