Details
- Reviewers
aaron.ballman - Group Reviewers
Restricted Project - Commits
- rG742970920b7a: [Clang] Implement CWG2358 Explicit capture of value
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/lib/Sema/SemaDeclCXX.cpp | ||
---|---|---|
169 | Can you add a test case showing what happens with structured bindings? e.g., int array[] = { 1, 2 }; auto [a, b] = array; void func(int c = [x = a] { return x; }()); Note, I think Clang has a bug here so you might have to write the test with a FIXME comment. (I don't think we implement https://wg21.link/cwg2358 or http://eel.is/c++draft/expr.prim.lambda#capture-3 properly yet.) The part that worries me there specifically is that a BindingDecl is a ValueDecl and not a VarDecl, so I think that cast<> may assert in this case. |
clang/lib/Sema/SemaDeclCXX.cpp | ||
---|---|---|
169 | *sigh* this is implementing CWG2358... So no FIXME comment, I think we should add a test to demonstrate that this works. |
clang/lib/Sema/SemaDeclCXX.cpp | ||
---|---|---|
107–111 | Note that https://reviews.llvm.org/D137244 introduces a utility to do that, but i''d rather avoid having to many dependencies between these patches. |
clang/lib/Sema/SemaDeclCXX.cpp | ||
---|---|---|
107–111 | Yup, i think this would be a good order of operation |
Note that https://reviews.llvm.org/D137244 introduces a utility to do that, but i''d rather avoid having to many dependencies between these patches.