Commit 1a68a4e8 by Jason Merrill Committed by Jason Merrill

re PR c++/15269 (__attribute__((deprecated)) broken with inline, ignored with…

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
parent a7f6bc8c
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.
......
......@@ -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]);
......
// PR c++/15269
struct B {
virtual int foo() __attribute__((deprecated));
};
int main(void) {
((B*)0)->foo(); // { dg-warning "deprecated" }
}
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