diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2012-07-17 21:03:05 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2012-07-17 21:03:05 +0000 |
commit | 26dc97cbeba8ced19972a259720a71aefa01ef43 (patch) | |
tree | 76ab72e6acf4012914c59a0c46f1b3a55165ac96 /test/CXX/expr/expr.const/p2-0x.cpp | |
parent | 251c449b280eb845017a6c022ed7189d17c63d49 (diff) |
Don't treat overflow in floating-point conversions as a hard error in constant evaluation. <rdar://problem/11874571>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160394 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CXX/expr/expr.const/p2-0x.cpp')
-rw-r--r-- | test/CXX/expr/expr.const/p2-0x.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/CXX/expr/expr.const/p2-0x.cpp b/test/CXX/expr/expr.const/p2-0x.cpp index 054669ef78..9e6716d0b8 100644 --- a/test/CXX/expr/expr.const/p2-0x.cpp +++ b/test/CXX/expr/expr.const/p2-0x.cpp @@ -131,14 +131,14 @@ namespace IncompleteClassTypeAddr { namespace UndefinedBehavior { void f(int n) { switch (n) { - case (int)4.4e9: // expected-error {{constant expression}} expected-note {{value 4.4E+9 is outside the range of representable values of type 'int'}} + case (int)4.4e9: // expected-error {{constant expression}} expected-note {{value 4.4E+9 is outside the range of representable values of type 'int'}} expected-note {{previous case defined here}} case (int)0x80000000u: // ok case (int)10000000000ll: // expected-note {{here}} case (unsigned int)10000000000ll: // expected-error {{duplicate case value}} case (int)(unsigned)(long long)4.4e9: // ok - case (int)(float)1e300: // expected-error {{constant expression}} expected-note {{value 1.0E+300 is outside the range of representable values of type 'float'}} + case (int)(float)1e300: // expected-error {{constant expression}} expected-note {{value 1.0E+300 is outside the range of representable values of type 'float'}} expected-error {{duplicate case value '2147483647'}} expected-note {{previous case defined here}} case (int)((float)1e37 / 1e30): // ok - case (int)(__fp16)65536: // expected-error {{constant expression}} expected-note {{value 65536 is outside the range of representable values of type 'half'}} + case (int)(__fp16)65536: // expected-error {{constant expression}} expected-note {{value 65536 is outside the range of representable values of type 'half'}} expected-error {{duplicate case value '2147483647'}} break; } } |