diff options
author | Jordan Rose <jordan_rose@apple.com> | 2012-10-20 02:32:51 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2012-10-20 02:32:51 +0000 |
commit | b59b580a57a36df9d146473098d14c64508ff319 (patch) | |
tree | a6c66e586a22c41f4c78bd5a70502d2c6d470ef7 /lib/Sema/SemaExpr.cpp | |
parent | 5016a70c183a50845a0421802d161093dd0643f6 (diff) |
[analyzer] Assume 'new' never returns NULL if it could throw an exception.
This is actually required by the C++ standard in
[basic.stc.dynamic.allocation]p3:
If an allocation function declared with a non-throwing
exception-specification fails to allocate storage, it shall return a
null pointer. Any other allocation function that fails to allocate
storage shall indicate failure only by throwing an exception of a type
that would match a handler of type std::bad_alloc.
We don't bother checking for the specific exception type, but just go off
the operator new prototype. This should help with a certain class of lazy
initalization false positives.
<rdar://problem/12115221>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166363 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
0 files changed, 0 insertions, 0 deletions