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

#include <initializer_list>
#define SA(X) static_assert(X,#X)

constexpr int f(std::initializer_list<int> l) { return l.begin()[0]; }

int main()
{
  constexpr int i = f({42});
  SA(i==42);
}