ioeric added a comment.

Nice!

Just one caveat regarding locations in addition to Sam's comments :)



================
Comment at: clang-tools-extra/clangd/Quality.cpp:48
+  if (R.ShadowDecl) {
+    const auto Loc = SourceMgr.getSpellingLoc(R.ShadowDecl->getLocation());
+    if (SourceMgr.isWrittenInMainFile(Loc))
----------------
I think we might want to use `getExpansionLoc` here. Consider `DEFINE_string` 
which is implemented like:
```
#define DEFINE_string(XXX) \
namespace FLs { \
SomeType FLAGS_XXX; \
} \
using FLs::FLAGS_XXX;
```
When you have `DEFINE_string(X) in the main file, the spelling location will be 
in the file where the macro is defined, while the expansion location will be in 
the main file, and I think we would want later.



https://reviews.llvm.org/D49012



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

Reply via email to