1 // RUN: %clang_cc1 -std=c++2a -verify %s
7 x
= static_cast<decltype(x
)&&>(x
);
10 void capture_default(int i
) {
11 auto x
= [=] {}; // expected-note 2{{candidate constructor}} expected-note 2{{lambda expression begins here}}
12 decltype(x
) y
; // expected-error {{no matching constructor}}
13 x
= x
; // expected-error {{cannot be assigned}}
14 x
= static_cast<decltype(x
)&&>(x
); // expected-error {{cannot be assigned}}
17 void explicit_capture(int i
) {
18 auto x
= [i
] {}; // expected-note 2{{candidate constructor}} expected-note 2{{lambda expression begins here}}
19 decltype(x
) y
; // expected-error {{no matching constructor}}
20 x
= x
; // expected-error {{cannot be assigned}}
21 x
= static_cast<decltype(x
)&&>(x
); // expected-error {{cannot be assigned}}