aboutsummaryrefslogtreecommitdiff
path: root/clang/test/SemaCXX/constexpr-unsigned-high-bit.cpp
blob: d85e645509d8e9ede330e7cdeaadc06cf737d2db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// RUN: %clang_cc1 -std=c++14 -fsyntax-only %s
// RUN: %clang_cc1 -std=c++14 -fsyntax-only -fexperimental-new-constant-interpreter %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;
}