This is an archive of the discontinued LLVM Phabricator instance.

Make Clang not crash on calls to destructors on incomplete pointer types
ClosedPublic

Authored by rzhikharevich on Jan 23 2019, 11:54 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

rzhikharevich created this revision.Jan 23 2019, 11:54 AM
rzhikharevich edited the summary of this revision. (Show Details)Jan 23 2019, 11:55 AM

Upload patches with full context please.
Also the diagnostic seems to be wrong ?
And finally is there a bug report for this ?

Upload patches with full context please.
Also the diagnostic seems to be wrong ?

I don't think so, the valid code would be 'p->~C()'.

And finally is there a bug report for this ?

No. Should I file one?

Upload patches with full context please.
Also the diagnostic seems to be wrong ?

I don't think so, the valid code would be 'p->~C()'.

You are right, my bad!

And finally is there a bug report for this ?

No. Should I file one?

No, it is just so that we can close the corresponding bug report if there is one.
Your fix seems reasonable to me. Thanks for the patch!

I guess you will want someone to commit it ?

I guess you will want someone to commit it ?

Yes, if the fix is correct.

riccibruno accepted this revision.Jan 23 2019, 12:39 PM

I guess you will want someone to commit it ?

Yes, if the fix is correct.

It looks to be correct to me since the problem is that LookupDestructor will dispatch to
Sema::LookupSpecialMember, which assumes that the CXXRecordDecl has a definition.

This revision is now accepted and ready to land.Jan 23 2019, 12:39 PM
This revision was automatically updated to reflect the committed changes.