1 // RUN: %clang_cc1 -fsyntax-only -std=c++1y %s -verify 2 3 int a; 4 int &b = [] (int &r) -> decltype(auto) { return r; } (a); 5 int &c = [] (int &r) -> decltype(auto) { return (r); } (a); 6 int &d = [] (int &r) -> auto & { return r; } (a); 7 int &e = [] (int &r) -> auto { return r; } (a); // expected-error {{cannot bind to a temporary}} 8 int &f = [] (int r) -> decltype(auto) { return r; } (a); // expected-error {{cannot bind to a temporary}} 9 int &g = [] (int r) -> decltype(auto) { return (r); } (a); // expected-warning {{reference to stack}} 10