================ @@ -0,0 +1,7 @@ +// RUN: %clang_cc1 -fsyntax-only -Wunused-lambda-capture -Wused-but-marked-unused -Wno-uninitialized -verify -std=c++20 %s + +void test() { + int i; + auto explicit_by_value_unused_requires = [i] (auto) requires requires { i; } {}; // expected-warning{{lambda capture 'i' is not required to be captured for this use}} ---------------- erichkeane wrote:
It would be PARTICULARLY good if we could 'remember' that it was 'used' in the requires clause so we can add a note that says something like (please consider wording and write better:)), `note: use in requires expr doesn't use captures because they are special`. https://github.com/llvm/llvm-project/pull/78598 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits