[PATCH] D137172: [Clang] Implement CWG2358 Explicit capture of value

2022-11-03 Thread Corentin Jabot via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG742970920b7a: [Clang] Implement CWG2358 Explicit capture of value (authored by cor3ntin). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137172/new/ https://

[PATCH] D137172: [Clang] Implement CWG2358 Explicit capture of value

2022-11-02 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added inline comments. Comment at: clang/lib/Sema/SemaDeclCXX.cpp:107-111 +if (const auto *BD = dyn_cast(Decl)) + VD = dyn_cast_if_present(BD->getDecomposedDecl()); +else + VD = dyn_cast(Decl); +if (VD) { aaron.ballman wrote: > cor3

[PATCH] D137172: [Clang] Implement CWG2358 Explicit capture of value

2022-11-02 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a reviewer: clang-language-wg. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! Adding the language WG in case there are reviews coming from the peanut gallery. Please wait a day before landing just in

[PATCH] D137172: [Clang] Implement CWG2358 Explicit capture of value

2022-11-02 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin updated this revision to Diff 472637. cor3ntin added a comment. Fix tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137172/new/ https://reviews.llvm.org/D137172 Files: clang/docs/ReleaseNotes.rst clang/lib/Sema/SemaDeclCXX.cpp c

[PATCH] D137172: [Clang] Implement CWG2358 Explicit capture of value

2022-11-02 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added inline comments. Comment at: clang/lib/Sema/SemaDeclCXX.cpp:107-111 +if (const auto *BD = dyn_cast(Decl)) + VD = dyn_cast_if_present(BD->getDecomposedDecl()); +else + VD = dyn_cast(Decl); +if (VD) { Note that https://reviews.l

[PATCH] D137172: [Clang] Implement CWG2358 Explicit capture of value

2022-11-02 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin updated this revision to Diff 472601. cor3ntin added a comment. Properly handle structured bindings in init capture Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137172/new/ https://reviews.llvm.org/D137172 Files: clang/docs/ReleaseNote

[PATCH] D137172: [Clang] Implement CWG2358 Explicit capture of value

2022-11-02 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Sema/SemaDeclCXX.cpp:162 +// Init captures are always VarDecl. +auto *D = cast(LC.getCapturedVar()); +Invalid |= Visit(D->getInit()); aaron.ballman wrote: > Can you add a test case showing wha

[PATCH] D137172: [Clang] Implement CWG2358 Explicit capture of value

2022-11-02 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Sema/SemaDeclCXX.cpp:162 +// Init captures are always VarDecl. +auto *D = cast(LC.getCapturedVar()); +Invalid |= Visit(D->getInit()); Can you add a test case showing what happens with structur

[PATCH] D137172: [Clang] Implement CWG2358 Explicit capture of value

2022-11-01 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin updated this revision to Diff 472386. cor3ntin added a comment. Fix tests + address aaron's feedback Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137172/new/ https://reviews.llvm.org/D137172 Files: clang/docs/ReleaseNotes.rst clang/l

[PATCH] D137172: [Clang] Implement CWG2358 Explicit capture of value

2022-11-01 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Precommit CI seems to have caught valid failures this time. Comment at: clang/lib/Sema/SemaDeclCXX.cpp:152 bool CheckDefaultArgumentVisitor::VisitLambdaExpr(const LambdaExpr *Lambda) { - // C++11 [expr.lambda.prim]p13: - // A lambda-expressio

[PATCH] D137172: [Clang] Implement CWG2358 Explicit capture of value

2022-11-01 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin created this revision. Herald added a project: All. cor3ntin requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D137172 Files: clang/docs/ReleaseNotes.rst clang/lib/