aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp1z/constexpr-if37.C
blob: e11e02cfa0eb0851b2934077408bb2dbb5988186 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// PR c++/105885
// { dg-do compile { target c++17 } }
// { dg-additional-options -Wall }

int i;

template<const char* ARG = nullptr>
void test() {
  if constexpr(ARG == nullptr) {
    ++i;
  } else {
    --i;
  }
}

const char CONSTSTR[] = {'\n', '\t', ' ', '\0'};

int main() {
  test();
  test<CONSTSTR>();
}