[cfe-commits] r136180 - in /cfe/trunk: lib/CodeGen/CGCXX.cpp test/CodeGenCXX/abstract-class-ctors-dtors.cpp

John McCall rjmccall at apple.com
Thu Jul 28 02:08:16 PDT 2011


On Jul 28, 2011, at 1:23 AM, Sebastian Redl wrote:

> On 27.07.2011 01:18, Douglas Gregor wrote:
>> Author: dgregor
>> Date: Tue Jul 26 18:18:30 2011
>> New Revision: 136180
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=136180&view=rev
>> Log:
>> Disable the optimization that skips emission of complete, non-virtual
>> destructors of abstract classes. It's undefined behavior to actually
>> call the destructor (e.g., via delete), but the presence of code that
>> calls this destructor doesn't make the program
>> ill-formed. Fixes<rdar://problem/9819242>.
>> 
> Can't we just replace the call with a trap instruction?

Not without aggressively breaking code that actually works perfectly
reasonably.  I'm pretty skeptical of strictly enforcing undefined
behavior when there's only one reasonable action for the compiler
and it has a substantial chance of being fully correct.

John.



More information about the cfe-commits mailing list