[PATCH] D25817: [Sema] Improve the error diagnostic for dot destructor calls on pointer objects

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 20 08:09:10 PDT 2016


On Thu, Oct 20, 2016 at 11:02 AM, David Blaikie <dblaikie at gmail.com> wrote:
> If we issue a fixit we should recover as-if the code was written with the
> fixit in. Does this code do that?

That's a good point; I don't think this patch does the fix.

> (can we test it? I know we test some
> fixits - not sure it's necessary/worthwhile to test them all, but maybe we
> have a good idiom for testing that the recovery is correct)

We have some fixit tests in the frontend. See test/FixIt/

~Aaron

>
> On Thu, Oct 20, 2016 at 6:47 AM Aaron Ballman <aaron.ballman at gmail.com>
> wrote:
>>
>> aaron.ballman accepted this revision.
>> aaron.ballman added a reviewer: aaron.ballman.
>> aaron.ballman added a comment.
>> This revision is now accepted and ready to land.
>>
>> LGTM
>>
>>
>>
>> ================
>> Comment at: lib/Sema/SemaExprCXX.cpp:6287
>> +            Context.hasSameUnqualifiedType(DestructedType,
>> +                                           ObjectType->getPointeeType()))
>> {
>> +          Diag(OpLoc, diag::err_typecheck_member_reference_suggestion)
>> ----------------
>> You can elide the curly braces.
>>
>>
>> Repository:
>>   rL LLVM
>>
>> https://reviews.llvm.org/D25817
>>
>>
>>
>


More information about the cfe-commits mailing list