[PATCH] D11334: [Sema] Call to deleted functions are supposed to be verboten

Davide Italiano dccitaliano at gmail.com
Tue Jul 21 14:42:30 PDT 2015


On Tue, Jul 21, 2015 at 8:44 AM, Aaron Ballman <aaron at aaronballman.com> wrote:
> On Sun, Jul 19, 2015 at 12:37 AM, Davide Italiano <dccitaliano at gmail.com> wrote:
>> davide created this revision.
>> davide added reviewers: rsmith, mclow.lists.
>> davide added a subscriber: cfe-commits.
>>
>> I originally tried to fix this in SemaExpr (ActOnCallExpr), putting this check just before BuildCallToMemberFunction() call, but eventaully convinced myself SemaOverload should be the right place to fix.
>
> I'll let Richard comment on whether this is the correct place for the
> fix or not, but some comments below.
>
>>
>> Thanks,
>>
>> --
>> Davide
>>
>> http://reviews.llvm.org/D11334
>>
>> Files:
>>   lib/Sema/SemaOverload.cpp
>>   test/SemaCXX/deleted-function-access.cpp
>>
>> Index: test/SemaCXX/deleted-function-access.cpp
>> ===================================================================
>> --- test/SemaCXX/deleted-function-access.cpp
>> +++ test/SemaCXX/deleted-function-access.cpp
>> @@ -0,0 +1,4 @@
>> +// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s
>> +
>> +struct S { virtual void f() = delete;
>> +            void g() { f(); } }; //expected-error{{call to deleted member function f}}
>
> This code is formatted a bit oddly.
>
I didn't pay too much attention to the formatting, to be honest, and I
missed this comment. Given it's minor, I'll change that before
committing, if the patch gets accepted. Thanks for noticing tho (and
for the review).



More information about the cfe-commits mailing list