[clang-tools-extra] [clang] [llvm] [clang] reject to capture variable in `RequiresExprBodyDecl` (PR #78598)

Congcong Cai via cfe-commits cfe-commits at lists.llvm.org
Sun Feb 4 07:11:27 PST 2024


HerrCai0907 wrote:

> You have an example of that? There may be further bugs there.
> id-expression that appear in any unevaluated context should not be captured ( typeid being an exception

I think it is from standard, but from user-friendly site. Now clang will hint user some variables is not need to capture. Which means it need to capture it and analyze it not need to capture.
https://godbolt.org/z/9jnx93r6e
```c++
auto explicit_by_value_unused_decltype = [i] { decltype(i) j = 0; };
```

https://github.com/llvm/llvm-project/pull/78598


More information about the cfe-commits mailing list