[PATCH] D64717: [Clangd] Fixed ExtractVariable for MemberExprs and Assignment Exprs
Shaurya Gupta via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 15 06:59:02 PDT 2019
SureYeaah marked an inline comment as done.
SureYeaah added inline comments.
================
Comment at: clang-tools-extra/clangd/unittests/TweakTests.cpp:323
while(a < ^1)
- ^a++;
+ [[a++]];
// do while
----------------
kadircet wrote:
> I thought extractor didn't handle this case(missing braces).
>
> What is the extraction in this case? Because if it is
>
> ```
> auto dummy = a++;
> while (a < 1)
> dummy++;
> ```
>
> it is not going to be semantically same.
We don't check for missing braces and continuing traversing up the AST until we find the CompoundStmt.
Yes, it's not going to be semantically the same. We only check if after extraction, the extracted expression will reference a variable that hasn't been declared till that point.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64717/new/
https://reviews.llvm.org/D64717
More information about the cfe-commits
mailing list