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:
parent
25a20a1c03
commit
60349f15cc
3 changed files with 24 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
16
gcc/testsuite/g++.dg/warn/deprecated-9.C
Normal file
16
gcc/testsuite/g++.dg/warn/deprecated-9.C
Normal 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;
|
||||
}
|
Loading…
Add table
Reference in a new issue