diff options
Diffstat (limited to 'test/SemaCXX/constexpr-unsigned-high-bit.cpp')
-rw-r--r-- | test/SemaCXX/constexpr-unsigned-high-bit.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/SemaCXX/constexpr-unsigned-high-bit.cpp b/test/SemaCXX/constexpr-unsigned-high-bit.cpp new file mode 100644 index 0000000000..19d8dcab66 --- /dev/null +++ b/test/SemaCXX/constexpr-unsigned-high-bit.cpp @@ -0,0 +1,15 @@ +// RUN: %clang_cc1 -std=c++14 -fsyntax-only %s + +#include <limits.h> + +constexpr unsigned inc() { + unsigned i = INT_MAX; + ++i; // should not warn value is outside range + return i; +} + +constexpr unsigned dec() { + unsigned i = INT_MIN; + --i; // should not warn value is outside range + return i; +} |