[cfe-dev] No -Wdeprecated-declarations at all on virtual calls?
Richard Smith
richard at metafoo.co.uk
Fri Apr 11 14:30:30 PDT 2014
On Tue, Mar 11, 2014 at 1:10 AM, Stephan Bergmann <sbergman at redhat.com>wrote:
> The code
>
> bool ShouldCheckUse = true;
>> if (CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(MemberDecl)) {
>> // Don't diagnose the use of a virtual member function unless it's
>> // explicitly qualified.
>> if (MD->isVirtual() && !SS.isSet())
>> ShouldCheckUse = false;
>> }
>>
>
> in lib/Sema/SemaExprMember.cpp, originally introduced with r81460 to fix <
> http://llvm.org/bugs/show_bug.cgi?id=4878> "ability to call deprecated
> virtual methods in the same class without warning" prevents warnings on all
> virtual calls to such deprecated functions. Not just when the call is from
> the same class, but also when a client of that class calls the function.
>
> Is that intentional? (I just had a case where it would have been useful
> to get the warning for the client-call case at least, and was surprised to
> not get a warning, esp. since GCC does give one.)
This looks like a bug to me, please file a PR!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140411/0f5e8c10/attachment.html>
More information about the cfe-dev
mailing list