re PR c++/15269 (__attribute__((deprecated)) broken with inline, ignored with pure virtual, misreported after definition)

PR c++/15269
        * call.c (build_over_call): Warn about deprecated virtuals.

From-SVN: r128682
This commit is contained in:
Jason Merrill 2007-09-23 00:37:26 -04:00 committed by Jason Merrill
parent a7f6bc8c74
commit 1a68a4e8c5
3 changed files with 17 additions and 0 deletions

View File

@ -1,5 +1,8 @@
2007-09-22 Jason Merrill <jason@redhat.com>
PR c++/15269
* call.c (build_over_call): Warn about deprecated virtuals.
PR c++/19407
* cp-tree.h (ATTR_IS_DEPENDENT): New macro.
(MAYBE_TAGGED_TYPE_P): Remove.

View File

@ -5128,6 +5128,11 @@ build_over_call (struct z_candidate *cand, int flags)
ba_any, NULL);
gcc_assert (binfo && binfo != error_mark_node);
/* Warn about deprecated virtual functions now, since we're about
to throw away the decl. */
if (TREE_DEPRECATED (fn))
warn_deprecated_use (fn);
argarray[0] = build_base_path (PLUS_EXPR, argarray[0], binfo, 1);
if (TREE_SIDE_EFFECTS (argarray[0]))
argarray[0] = save_expr (argarray[0]);

View File

@ -0,0 +1,9 @@
// PR c++/15269
struct B {
virtual int foo() __attribute__((deprecated));
};
int main(void) {
((B*)0)->foo(); // { dg-warning "deprecated" }
}