ioeric added inline comments.
================ Comment at: clangd/IncludeFixer.cpp:235 + std::string Spelling = (Code.substr(B, E - B) + "::").str(); + if (llvm::StringRef(SpecifiedNS).endswith(Spelling)) + SpecifiedScope = SpecifiedNS; ---------------- sammccall wrote: > hmm, won't this heuristic have false positives? > ``` > // indexed-header.h > namespace a { int X; } > > // main-file.cc > namespace b = a; > namespace c { int Y = b::x; } > ``` > I worry spelling is going to be "b::" here, while SpecifiedNS is going to be > "a::". Thanks for pointing this out! I completely missed the namespace alias case. Fixed and added a test. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58185/new/ https://reviews.llvm.org/D58185 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits