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

Eli Friedman eli.friedman at gmail.com
Tue Jul 26 20:21:23 PDT 2011


On Tue, Jul 26, 2011 at 4:52 PM, David Blaikie <dblaikie at gmail.com> wrote:
>>>> Re-fix r136172 so it isn't an error; apparently, some people are fond of their undefined behavior.
>>>
>>> Would it be practical to emit something like an llvm_unreachable, call
>>> to terminate, or other "bad stuff has happened here" kind of code
>>> instead?
>>
>> Apparently real-world code uses this construct.  See also r136180.
>
> Right - the point made in r136180 is that it's UB to run the code, but
> not erroneous to have the code, which sounds like a perfect case for
> llvm_unreachable, if it's practical to emit it in this case.
>
> Unless you're saying real-world code is depending on the specific
> current behavior of LLVM when that code is executed (ie: they're
> actually invoking UB & depending on it doing something in particular)

This.

-Eli




More information about the cfe-commits mailing list