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

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 21 02:38:24 PST 2020


sammccall 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())
----------------
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)


================
Comment at: clang-tools-extra/clangd/unittests/FindTargetTests.cpp:566
     TU.ExtraArgs.push_back("-fno-delayed-template-parsing");
-    TU.ExtraArgs.push_back("-std=c++17");
+    TU.ExtraArgs.push_back("-std=c++2a");
 
----------------
isn't this spelled c++20 yet?


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