hokein added inline comments.
================
Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:73
+ if (auto RD = dyn_cast<CXXRecordDecl>(D)) {
+ if (auto DC = RD->getDestructor()) {
+ auto Range = DC->getSourceRange();
----------------
jvikstrom wrote:
> hokein wrote:
> > Here is the case:
> >
> > ```
> > class Foo {
> > ~Foo
> > // ^~~ we get a TypeLoc whose TagDecl is a cxxRecordDecl.
> > }
> > ```
> > not sure this is expected in clang AST, but it is unreasonable in
> > highlighting context -- ideally, we want to highlight `~Foo` as a
> > destructor (we may encounter a tricky case, like `~ /*comment*/ Foo()`, but
> > I assume this is rarce, should be fine), @sammccall, @ilya-biryukov,
> > thoughts?
> Do we want to highlight the entire "~Foo" or only the ~"Foo" for destructors?
>
based on our discussion, we'd just highlight ~"Foo" as a class type for now.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64257/new/
https://reviews.llvm.org/D64257
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits