commit a2de40417b69ee1a42396ecbe8ca7e02a7541160
Author: Jason Merrill <jason@redhat.com>
Date: Thu Jan 21 14:45:05 2016 -0500
PR c++/65687
* decl.c (type_is_deprecated): Don't look into a typedef.
@@ -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))
new file mode 100644
@@ -0,0 +1,14 @@
+// PR c++/65687
+
+typedef struct old_visible_stuff *opaquePointer;
+
+struct old_visible_stuff {
+ int things_we_no_longer;
+ int wish_to_expose;
+} __attribute__((__deprecated__("do not refer to this, the layout might change")));
+
+typedef struct old_visible_stuff *another; // { dg-warning "deprecated" }
+
+opaquePointer runtime_function (opaquePointer someObject);
+
+opaquePointer bad_runtime_call (struct old_visible_stuff *otherObject); // { dg-warning "deprecated" }