[PATCH] D77656: [clangd] Fix a crash bug in AddUsing tweak around template handling.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 7 18:32:40 PDT 2020


sammccall accepted this revision.
sammccall added a comment.
This revision is now accepted and ready to land.

Whoops, indeed.
There should be a version of falsehoods programmers believe about names <https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/> for the clang AST :-)

- Decls have names
- well, NamedDecls have names
- Decls that are not NamedDecls don't have names
- if a NamedDecl has a name, that name is an identifier
- ...



================
Comment at: clang-tools-extra/clangd/refactor/tweaks/AddUsing.cpp:212
+        Name =
+            E.getType().getUnqualifiedType().getBaseTypeIdentifier()->getName();
+        QualifierToRemove = E.getQualifierLoc();
----------------
BaseTypeIdentifier->getName()


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77656





More information about the cfe-commits mailing list