summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-02-04 05:35:53 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-02-04 05:35:53 +0000
commitbcc9bcb65fe28af2ca256af21b34aed76c357097 (patch)
treecb3411ee563134c8e1230c0943ceb90cdb063de1 /llvm/lib/CodeGen
parent5d8e7593e384abe27a9ed4cd80fedd2cb46a127a (diff)
downloadbcm5719-llvm-bcc9bcb65fe28af2ca256af21b34aed76c357097.tar.gz
bcm5719-llvm-bcc9bcb65fe28af2ca256af21b34aed76c357097.zip
Fix a rejects-valid in C++11: array new of a negative size, or overflowing array
new, is well-formed with defined semantics of throwing (a type which can be caught by a handler for) std::bad_array_new_length, unlike in C++98 where it is somewhere nebulous between undefined behavior and ill-formed. If the array size is an integral constant expression and satisfies one of these criteria, we would previous the array new expression, but now in C++11 mode, we merely issue a warning (the code is still rejected in C++98 mode, naturally). We don't yet implement new C++11 semantics correctly (see PR11644), but we do implement the overflow checking, and (for the default operator new) convert such expressions to an exception, so accepting such code now does not seem especially unsafe. llvm-svn: 149767
Diffstat (limited to 'llvm/lib/CodeGen')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud