summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp1z/constexpr-if3.C
blob: 1cc5780416f195cf5d6a0cc7bf51e77b52beb788 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// Testcase from P0292R2
// { dg-do link { target c++11 } }
// { dg-options "" }

extern int x;   // no definition of x required
int main() {
  if constexpr (true) // { dg-warning "constexpr" "" { target c++14_down } }
    return 0;
  else if (x)
    return x;
  else
    return -x;
}