On Thu, Jul 28, 2011 at 1:22 AM, Sebastian Redl
<[email protected]> wrote:
> On 27.07.2011 00:50, Eli Friedman wrote:
>> Author: efriedma
>> Date: Tue Jul 26 17:50:18 2011
>> New Revision: 136172
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=136172&view=rev
>> Log:
>> Diagnose trying to delete a pointer to an abstract class with a non-virtual 
>> destructor. PR10504.
>>
>> I'm not completely sure the standard allows us to reject this, but if it 
>> doesn't, it should. :)
>>
> It's undefined behavior, but only if that code path is ever reached.
> I wish C++ would allow compilers to reject a program if any single
> function is provably always undefined, but unfortunately it doesn't -
> we'd have to prove that this function will be called in every possible
> program execution as well.
>
> Might be interesting as a compiler flag, though.

Maybe... being able to write undefined operations can be convenient in
macros/templates/etc, though.

Note that I changed this in a subsequent commit to downgrade it to a
warning (which is on by default).

-Eli
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to