From 04559a79415e813283ddfbb8cdfdde5620c95f3b Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Wed, 30 Jul 2014 23:50:53 +0000 Subject: Updating a comment related to the implementation of -Woverloaded-virtual, and adding a FIXME to a test case. (Drive-by removal of trailing whitespace in the test case as well.) No functional changes. llvm-svn: 214362 --- clang/test/SemaCXX/warn-overloaded-virtual.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'clang/test/SemaCXX/warn-overloaded-virtual.cpp') diff --git a/clang/test/SemaCXX/warn-overloaded-virtual.cpp b/clang/test/SemaCXX/warn-overloaded-virtual.cpp index 629d59dee53..6204826192d 100644 --- a/clang/test/SemaCXX/warn-overloaded-virtual.cpp +++ b/clang/test/SemaCXX/warn-overloaded-virtual.cpp @@ -48,8 +48,8 @@ struct Base { void Base::foo(int) { } struct Derived : public Base { - virtual void foo(int); - void foo(int, int); + virtual void foo(int); + void foo(int, int); }; } @@ -138,3 +138,21 @@ namespace { // expected-warning@-1{{hides overloaded virtual functions}} }; } + +namespace { +struct base { + void f(char) {} +}; + +struct derived : base { + void f(int) {} +}; + +void foo(derived &d) { + d.f('1'); // FIXME: this should warn about calling (anonymous namespace)::derived::f(int) + // instead of (anonymous namespace)::base::f(char). + // Note: this should be under a new diagnostic flag and eventually moved to a + // new test case since it's not strictly related to virtual functions. + d.f(12); // This should not warn. +} +} -- cgit v1.2.3