Commit 823dd937 by Jason Merrill Committed by Jason Merrill

re PR c++/16370 (__attribute__((deprecated)) not useful on classes, and ugly…

re PR c++/16370 (__attribute__((deprecated)) not useful on classes, and ugly function name listed for deperecation warnings on constructor)

        PR c++/16370
        * decl.c (grokdeclarator): Look through implicit TYPE_DECLs
        for deprecation warnings.

From-SVN: r128691
parent 4637cb92
2007-09-23 Jason Merrill <jason@redhat.com>
PR c++/16370
* decl.c (grokdeclarator): Look through implicit TYPE_DECLs
for deprecation warnings.
2007-09-22 Jason Merrill <jason@redhat.com>
PR c++/15269
......
......@@ -7512,6 +7512,10 @@ grokdeclarator (const cp_declarator *declarator,
{
typedef_decl = type;
type = TREE_TYPE (typedef_decl);
if (TREE_DEPRECATED (type)
&& DECL_ARTIFICIAL (typedef_decl)
&& deprecated_state != DEPRECATED_SUPPRESS)
warn_deprecated_use (type);
}
/* No type at all: default to `int', and set DEFAULTED_INT
because it was not a user-defined typedef. */
......
// PR c++/16370
struct Foo { int i; } __attribute__ ((deprecated));
void foo() { Foo f; } // { dg-warning "deprecated" }
......@@ -98,11 +98,11 @@ class T {
int x;
} __attribute__ ((deprecated));
T *p3;
T *p3; // { dg-warning "'T' is deprecated" }
inline void T::member1(int) {}
int T::member3(T *p)
int T::member3(T *p) // { dg-warning "'T' is deprecated" }
{
p->member1(1); /* { dg-warning "'void T::member1\\(int\\)' is deprecated" "" } */
(*p).member1(2); /* { dg-warning "'void T::member1\\(int\\)' is deprecated" "" } */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment