lambda-deduce-neg.C 230 Bytes
Newer Older
1
// { dg-do compile { target c++11 } }
2 3 4

int main() {
  int i = 0;
Jason Merrill committed
5
  int& r = [&] () { return i; } (); // { dg-error "" "invalid initialization of non-const reference of type .int&. from a temporary of type .int." }
6 7 8 9

  return 0;
}