jvikstrom marked an inline comment as done.
jvikstrom added inline comments.


================
Comment at: clang-tools-extra/clangd/unittests/ClangdUnitTests.cpp:260
+    // Macros from token concatenations included.
+    #define CONCAT(X) X##1()
+    #define MACRO1() 123
----------------
ilya-biryukov wrote:
> Could we also test?
> ```
> #define PREPEND(X) Foo##X
> ```
> 
> It'll probably be the same, but still interesting to see whether it's any 
> differnet.
So it turns out that the tests weren't actually passing before, must have 
accidentally forgot to save the file or something before compiling. Anyways 
tokens from concatenations are not included right now (which for highlighting 
is probably what we want, we don't highlight types/names that are from macro 
concatenations either)

But the reason they are not are because:
* They do not pass the `isInsideMainFile` check. Their file id is set to 
something that prints `<scratch space>` when dumped
* Even if they did pass the check the SourceLocation does not seem to be 
correct. They return the same SourceLocation as the parent `CONCAT` or `PREPEND`

Don't know how to fix any of this, and don't know if we actually want to 
collect these expansions either.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D66928



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

Reply via email to