summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/new-with-exceptions.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer] Assume 'new' never returns NULL if it could throw an exception.Jordan Rose2012-10-201-0/+71
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> llvm-svn: 166363
OpenPOWER on IntegriCloud