aboutsummaryrefslogtreecommitdiff
path: root/test/CXX/expr/expr.const
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-01-31 23:24:19 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-01-31 23:24:19 +0000
commit3df61308ddfbdba0897b762a129b5a38750c87d0 (patch)
tree304aecb1ddc8469b0d97ff6bc45e2cad070635ab /test/CXX/expr/expr.const
parentd29975fd08713eb9d1777e60536addaa62df8995 (diff)
constexpr: Treat INT_MIN % -1 as undefined behavior in C++11. Technically, it
isn't, but this is just a (reported) defect in the wording. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149448 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CXX/expr/expr.const')
-rw-r--r--test/CXX/expr/expr.const/p2-0x.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/CXX/expr/expr.const/p2-0x.cpp b/test/CXX/expr/expr.const/p2-0x.cpp
index 617edc5faa..390364df63 100644
--- a/test/CXX/expr/expr.const/p2-0x.cpp
+++ b/test/CXX/expr/expr.const/p2-0x.cpp
@@ -134,6 +134,7 @@ namespace UndefinedBehavior {
constexpr int div0 = 3 / 0; // expected-error {{constant expression}} expected-note {{division by zero}} expected-warning {{undefined}}
constexpr int mod0 = 3 % 0; // expected-error {{constant expression}} expected-note {{division by zero}} expected-warning {{undefined}}
constexpr int int_min_div_minus_1 = int_min / -1; // expected-error {{constant expression}} expected-note {{value 2147483648 is outside the range}}
+ constexpr int int_min_mod_minus_1 = int_min % -1; // expected-error {{constant expression}} expected-note {{value 2147483648 is outside the range}}
constexpr int shl_m1 = 0 << -1; // expected-error {{constant expression}} expected-note {{negative shift count -1}} expected-warning {{negative}}
constexpr int shl_0 = 0 << 0; // ok