summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/constexpr-switch.C
blob: d229304e419c1d3816b1b071f8cfcd6993685dd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// { dg-options -std=c++0x }

template<class T>
constexpr T value(T t = T()) { return t; }

enum us_enum { us_item = value<short>() }; // OK

void func(us_enum n) {
  switch (n) {
  case value(us_item): ; // #1 Error
  default: ;
  }
}