diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-02-01 08:10:20 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-02-01 08:10:20 +0000 |
| commit | 1b470417e4255ac6343e0acafdcf57f21bf24e81 (patch) | |
| tree | c1bcc5bca49dcb0033d9aaf9d0a288519a609b2c /clang/INPUTS/cfg-nested-var-scopes.cpp | |
| parent | 6b2bd93918bceac12b0aea61fd13a65676cd4577 (diff) | |
| download | bcm5719-llvm-1b470417e4255ac6343e0acafdcf57f21bf24e81.tar.gz bcm5719-llvm-1b470417e4255ac6343e0acafdcf57f21bf24e81.zip | |
constexpr: check for overflow in pointer subtraction.
This is a mess. According to the C++11 standard, pointer subtraction only has
undefined behavior if the difference of the array indices does not fit into a
ptrdiff_t.
However, common implementations effectively perform a char* subtraction first,
and then divide the result by the element size, which can cause overflows in
some cases. Those cases are not considered to be undefined behavior by this
change; perhaps they should be.
llvm-svn: 149490
Diffstat (limited to 'clang/INPUTS/cfg-nested-var-scopes.cpp')
0 files changed, 0 insertions, 0 deletions

