jvikstrom added inline comments.

================
Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:38
   bool VisitNamedDecl(NamedDecl *ND) {
-    // FIXME: (De)Constructors/operator need to be highlighted some other way.
+    // Constructors have a TypePtr TagDecl that is a Function, therefore we 
need
+    // to get constructors as a NamedDecl instead.
----------------
hokein wrote:
> I don't understand this comment -- when visiting the constructor AST, we get 
> a TagTypeLoc, and its underlying Decl is a `CXXConstructorDecl`
So the Constructor TypeLoc does not have a TagTypeDecl and is not a TagTypeLoc. 
When we get the TypePtr of the constructor it's a "FunctionProtoType" and there 
is no way to distinguish it from other functions. Therefore we need to get the 
constructor decls as NamedDecls..

The comment was written badly though. This version should be better now I hope.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D64257



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to