commit 3e78f42251b5a82bc3aa2c00b85e40abb54fc70f
Author: Jason Merrill <jason@redhat.com>
Date: Fri Aug 14 17:41:24 2015 +0100
PR c++/65974
* decl2.c (mark_vtable_entries): Suppress -Wdeprecated.
@@ -1742,6 +1742,9 @@ mark_vtable_entries (tree decl)
tree fnaddr;
unsigned HOST_WIDE_INT idx;
+ /* It's OK for the vtable to refer to deprecated virtual functions. */
+ warning_sentinel w(warn_deprecated_decl);
+
FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (DECL_INITIAL (decl)),
idx, fnaddr)
{
new file mode 100644
@@ -0,0 +1,16 @@
+// PR c++/65974
+// { dg-options "-Wdeprecated" }
+
+struct S {
+ void bar();
+
+ __attribute__((deprecated("use bar() instead.")))
+ virtual void foo();
+};
+
+void S::foo() { bar(); }
+
+int main()
+{
+ return 0;
+}