PR c++/16370
* decl.c (grokdeclarator): Look through implicit TYPE_DECLs
for deprecation warnings.
From-SVN: r128691
+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
{
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. */
--- /dev/null
+// PR c++/16370
+
+struct Foo { int i; } __attribute__ ((deprecated));
+void foo() { Foo f; } // { dg-warning "deprecated" }
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" "" } */