blob: dc393d75915eb864017a1e148962e16886a7ec46 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
// The FCD doesn't allow typedefs and static_assert in constexpr functions,
// but it should.
// { dg-options "-std=c++0x -pedantic" }
template <class T>
constexpr T f(T t)
{
typedef T T2; // { dg-warning "constexpr" "" { xfail *-*-* } }
static_assert (T2(0) == T(0), ""); // { dg-warning "constexpr" "" { xfail *-*-* } }
return t;
}
int main()
{
constexpr int i = f(42);
}
|