blob: 474ce88f81f3151b9711e2f67fbc2d1414934d5c [file] [log] [blame]
// Testcase from P0170R1
// { dg-do compile { target c++17 } }
auto ID = [](auto a) { return a; };
static_assert( ID (3) == 3); // OK
struct NonLiteral {
NonLiteral(int n) : n(n) { }
int n;
};
static_assert( ID (NonLiteral{3}).n == 3); // { dg-error "non-literal" }
// { dg-prune-output "static assertion" }