]> granicus.if.org Git - clang/commit
PR11604: don't allow floating-literal-to-integer casts in ICEs if the (truncated)
authorRichard Smith <richard-llvm@metafoo.co.uk>
Sun, 18 Dec 2011 02:33:09 +0000 (02:33 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Sun, 18 Dec 2011 02:33:09 +0000 (02:33 +0000)
commit2116b144cf07f2574d20517187eb8863645376eb
treefeb8e4d4d5b0e3a20f6281f2a854d2dd065340a4
parenta1be278c4f3a234ff61f04018d26c6beecde1654
PR11604: don't allow floating-literal-to-integer casts in ICEs if the (truncated)
floating literal value does not fit into the destination type. Such casts have
undefined behavior at translation time; treating them as non-ICE matches the
behavior of modern gcc versions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146842 91177308-0d34-0410-b5e6-96231b3b80d8
lib/AST/ExprConstant.cpp
test/SemaCXX/constant-expression.cpp