summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice2.C
blob: a78688a4b1e1d2cc6ff824eba525e64abab244c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// PR c++/42083
// { dg-do compile { target c++11 } }

template<typename F>
decltype(F()) run(F f) // { dg-message "note" "" { target c++17_down } }
{
  return f();	// { dg-error "could not convert" "" { target c++2a } }
}

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

  run(l); // { dg-error "no match" "" { target c++17_down } }
  // { dg-error "use of deleted function" "candidate explanation" { target c++17_down } 5 }
}