[PATCH] D72867: [clangd] Support renaming designated initializers

Kirill Bobyrev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 3 05:23:27 PST 2020


kbobyrev added inline comments.


================
Comment at: clang-tools-extra/clangd/FindTarget.cpp:639
+    void VisitDesignatedInitExpr(const DesignatedInitExpr *DIE) {
+      for (const DesignatedInitExpr::Designator &D : DIE->designators()) {
+        if (!D.isFieldDesignator())
----------------
sammccall wrote:
> you're breaking after the first one - I think you'd like to report every one instead?
> You'd test this with a DIE like `{ .Foo.Bar = 2 }` where `Foo` has struct type.
> 
> (targetDecl only reports the *last* one, because the Designator can't be a DynTypedNode, but we don't care about that here)
Sorry, I tried to understand this comment but I wasn't able to in the end. Could you please elaborate on this?

I'm adding the test cases that I originally thought you meant, but those work correctly so I assume I didn't understand what case you were referring to.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72867/new/

https://reviews.llvm.org/D72867





More information about the cfe-commits mailing list