This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Add "inline" keyword to prevent ODR-violations in DefineInline
ClosedPublic

Authored by kadircet on Oct 1 2019, 1:40 AM.

Diff Detail

Event Timeline

kadircet created this revision.Oct 1 2019, 1:40 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 1 2019, 1:40 AM

Build result: pass - 60290 tests passed, 0 failed and 732 were skipped.

Log files: console-log.txt, CMakeCache.txt

Build result: pass - 60656 tests passed, 0 failed and 726 were skipped.

Log files: console-log.txt, CMakeCache.txt

hokein accepted this revision.Dec 10 2019, 12:07 PM

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

clang-tools-extra/clangd/refactor/tweaks/DefineInline.cpp
373

nit: use isHeaderFile in SourceCode.h.

clang-tools-extra/clangd/unittests/TweakTests.cpp
1858

could you add a test case for partial template specializations? I think we don't need the inline for that.

This revision is now accepted and ready to land.Dec 10 2019, 12:07 PM
kadircet updated this revision to Diff 233751.Dec 13 2019, 1:07 AM
kadircet marked 3 inline comments as done.
  • Address comments and rebase
clang-tools-extra/clangd/unittests/TweakTests.cpp
1858

there's no such thing as partial specialization for functions, and we don't allow inlining inside templated classes.

This revision was automatically updated to reflect the committed changes.

Unit tests: pass. 60834 tests passed, 0 failed and 726 were skipped.

clang-format: fail. Please format your changes with clang-format by running git-clang-format HEAD^ or apply this patch.

Build artifacts: console-log.txt, CMakeCache.txt, clang-format.patch, test-results.xml, diff.json