[PATCH] D83681: [clang] Provide a more specific diagnostic for a misplaced lambda capture-default.
Bruno Ricci via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 15 07:45:50 PDT 2020
riccibruno added inline comments.
================
Comment at: clang/lib/Parse/ParseExprCXX.cpp:937
+ return Invalid([&] {
+ Diag(Tok.getLocation(), diag::err_capture_default_first);
+ });
----------------
aaron.ballman wrote:
> Would it make sense to provide a fix-it to move the capture default to the start of the list automatically, or is that a pain?
I have thought about doing that, but my understanding is that a fix-it must fix the error. But here the capture-default might conflict with one of the other captures (both before and after).
To make sure that the fix-it is safe we would have to look at the other captures (before and after). This is certainly not impossible but a bit more tricky.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D83681/new/
https://reviews.llvm.org/D83681
More information about the cfe-commits
mailing list