17 lines · cpp
1// RUN: %clang_cc1 -std=c++14 -fsyntax-only %s2// RUN: %clang_cc1 -std=c++14 -fsyntax-only -fexperimental-new-constant-interpreter %s3 4#include <limits.h>5 6constexpr unsigned inc() {7 unsigned i = INT_MAX;8 ++i; // should not warn value is outside range9 return i;10}11 12constexpr unsigned dec() {13 unsigned i = INT_MIN;14 --i; // should not warn value is outside range15 return i;16}17