aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice2.C
blob: 6468f18a0acb5cab18187617ab830d73ceed66c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// PR c++/42083
// { dg-options "-std=c++0x" }

template<typename F>
decltype(F()) run(F f) // { dg-message "note" }
{
  return f();
}

int main()
{
  auto l = []() { return 5; }; // { dg-message "lambda closure type" }

  run(l); // { dg-error "no match" }
  // { dg-message "candidate" "candidate note" { target *-*-* } 14 }
  // { dg-error "use of deleted function" "candidate explanation" { target *-*-* } 5 }
}