[cfe-commits] r90283 - in /cfe/trunk: lib/Sema/Sema.h lib/Sema/SemaDeclCXX.cpp lib/Sema/SemaExprCXX.cpp test/CodeGenCXX/virtual-destructor-synthesis.cpp

Eli Friedman eli.friedman at gmail.com
Tue Dec 1 18:25:51 PST 2009


On Tue, Dec 1, 2009 at 6:00 PM, Fariborz Jahanian <fjahanian at apple.com> wrote:
>
> On Dec 1, 2009, at 3:43 PM, Eli Friedman wrote:
>
>> On Tue, Dec 1, 2009 at 3:18 PM, Fariborz Jahanian <fjahanian at apple.com>
>> wrote:
>>>
>>> Author: fjahanian
>>> Date: Tue Dec  1 17:18:25 2009
>>> New Revision: 90283
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=90283&view=rev
>>> Log:
>>> Fix a code gen. crash synthesizing a destructor.
>>> Fixes pr5660.
>>
>> This patch looks very wrong.  I think the real issue here is something
>> similar to PR5557: Sema doesn't know whether the vtable is created,
>> and therefore doesn't do the stuff that MarkDeclarationReferenced is
>> supposed to do for virtual functions.
>
> Yes, that is the problem. Patch just looks up the delete operator
> and makes it available in the destructor to be used, if synthesis is
> to occur. Can you point to what can go wrong?

What if there isn't any valid delete operator?  I'm not entirely sure
off the top of my head how that would happen, but I think it's
possible.  We don't print a diagnostic, and there isn't a delete
operator, so we're back to crashing.

-Eli




More information about the cfe-commits mailing list