You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
auto explicit_by_value_unused_requires = [i] (auto) requiresrequires { i; } {}; // expected-warning{{lambda capture 'i' is not required to be captured for this use}}
Copy file name to clipboardExpand all lines: clang/test/SemaCXX/warn-unused-lambda-capture.cpp
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,10 @@ void test() {
44
44
auto explicit_by_value_unused_sizeof = [i] { returnsizeof(i); }; // expected-warning{{lambda capture 'i' is not required to be captured for this use}}
45
45
auto explicit_by_value_unused_decltype = [i] { decltype(i) j = 0; }; // expected-warning{{lambda capture 'i' is not required to be captured for this use}}
46
46
auto explicit_by_value_unused_const = [k] { return k + 1; }; // expected-warning{{lambda capture 'k' is not required to be captured for this use}}
47
+
#if __cplusplus >= 202002L
48
+
auto explicit_by_value_unused_requires = [i] (auto) requiresrequires { i; } {}; // expected-warning{{lambda capture 'i' is not required to be captured for this use}}
49
+
explicit_by_value_unused_requires(1);
50
+
#endif
47
51
48
52
auto explicit_by_reference_used = [&i] { i++; };
49
53
auto explicit_by_reference_unused = [&i] {}; // expected-warning{{lambda capture 'i' is not used}}
0 commit comments