xref: /llvm-project/clang/test/SemaCXX/constexpr-unsigned-high-bit.cpp (revision cfa30fa4852275eed0c59b81b5d8088d3e55f778)
1 // RUN: %clang_cc1 -std=c++14 -fsyntax-only %s
2 // RUN: %clang_cc1 -std=c++14 -fsyntax-only -fexperimental-new-constant-interpreter %s
3 
4 #include <limits.h>
5 
inc()6 constexpr unsigned inc() {
7   unsigned i = INT_MAX;
8   ++i; // should not warn value is outside range
9   return i;
10 }
11 
dec()12 constexpr unsigned dec() {
13   unsigned i = INT_MIN;
14   --i; // should not warn value is outside range
15   return i;
16 }
17