[cfe-commits] r136183 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaExprCXX.cpp test/SemaCXX/new-delete.cpp
David Blaikie
dblaikie at gmail.com
Tue Jul 26 16:52:10 PDT 2011
>>> 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)
which sounds highly dodgy, but I wouldn't put it past someone. I'm not
sure what the LLVM/clang project's stance on such situations is.
- David
More information about the cfe-commits
mailing list