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
This commit is contained in:
Jason Merrill 2015-08-15 03:59:26 -04:00 committed by Jason Merrill
parent 25a20a1c03
commit 60349f15cc
3 changed files with 24 additions and 0 deletions

View File

@ -1,3 +1,8 @@
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>
PR c++/67104

View File

@ -1747,6 +1747,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)
{

View File

@ -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;
}