[cfe-commits] r136172 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaExprCXX.cpp test/SemaCXX/new-delete.cpp

Sebastian Redl sebastian.redl at getdesigned.at
Thu Jul 28 01:22:17 PDT 2011


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.

Sebastian



More information about the cfe-commits mailing list