[PATCH] D68261: [clangd] Add "inline" keyword to prevent ODR-violations in DefineInline

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 10 12:10:19 PST 2019


hokein accepted this revision.
hokein added a comment.
This revision is now accepted and ready to land.

I think we probably want to do the vice-versa thing (remove the inline keyword) in define-outline.



================
Comment at: clang-tools-extra/clangd/refactor/tweaks/DefineInline.cpp:373
+
+  const SourceManager &SM = FD->getASTContext().getSourceManager();
+  llvm::StringRef FileName = SM.getFilename(FD->getLocation());
----------------
nit: use `isHeaderFile` in SourceCode.h.


================
Comment at: clang-tools-extra/clangd/unittests/TweakTests.cpp:1913
+
+  // Specializations needs to be marked "inline".
+  ExtraFiles["a.h"] = R"cpp(
----------------
could you add a test case for  partial template specializations? I think we don't need the inline for that.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D68261





More information about the cfe-commits mailing list