comparison clang/test/SemaCXX/lambda-invalid-capture.cpp @ 221:79ff65ed7e25

LLVM12 Original
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 15 Jun 2021 19:15:29 +0900
parents 1d019706d866
children c4bab56944e8
comparison
equal deleted inserted replaced
220:42394fc6a535 221:79ff65ed7e25
16 auto q = [child]{}; 16 auto q = [child]{};
17 const int n = sizeof(q); 17 const int n = sizeof(q);
18 } 18 }
19 19
20 int pr43080(int i) { // expected-note {{declared here}} 20 int pr43080(int i) { // expected-note {{declared here}}
21 return [] { // expected-note {{begins here}} 21 return [] { // expected-note {{begins here}} expected-note 2 {{capture 'i' by}} expected-note 2 {{default capture by}}
22 return sizeof i < 22 return sizeof i <
23 i; // expected-error {{variable 'i' cannot be implicitly captured in a lambda with no capture-default specified}} 23 i; // expected-error {{variable 'i' cannot be implicitly captured in a lambda with no capture-default specified}}
24 }(); 24 }();
25 } 25 }