Commit 60349f15 by Jason Merrill Committed by Jason Merrill

re PR c++/65974 (Bogus deprecated-declarations warnings for inline definitions…

re PR c++/65974 (Bogus deprecated-declarations warnings for inline definitions of deprecated virtual methods)

	PR c++/65974
	* decl2.c (mark_vtable_entries): Suppress -Wdeprecated.

From-SVN: r226908
parent 25a20a1c
2015-08-14 Jason Merrill <jason@redhat.com>
PR c++/65974
* decl2.c (mark_vtable_entries): Suppress -Wdeprecated.
2015-08-12 Jason Merrill <jason@redhat.com> 2015-08-12 Jason Merrill <jason@redhat.com>
PR c++/67104 PR c++/67104
......
...@@ -1747,6 +1747,9 @@ mark_vtable_entries (tree decl) ...@@ -1747,6 +1747,9 @@ mark_vtable_entries (tree decl)
tree fnaddr; tree fnaddr;
unsigned HOST_WIDE_INT idx; 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)), FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (DECL_INITIAL (decl)),
idx, fnaddr) idx, fnaddr)
{ {
......
// 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;
}
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