Skip to content

Commit 2f759e4

Browse files
committed
Migrate clangd away from -fno-delayed-template-parsing
1 parent d3ed992 commit 2f759e4

File tree

7 files changed

+3
-16
lines changed

7 files changed

+3
-16
lines changed

clang-tools-extra/clangd/CodeComplete.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,10 +1393,6 @@ bool semaCodeComplete(std::unique_ptr<CodeCompleteConsumer> Consumer,
13931393
FrontendOpts.SkipFunctionBodies = true;
13941394
// Disable typo correction in Sema.
13951395
CI->getLangOpts().SpellChecking = false;
1396-
// Code completion won't trigger in delayed template bodies.
1397-
// This is on-by-default in windows to allow parsing SDK headers; we're only
1398-
// disabling it for the main-file (not preamble).
1399-
CI->getLangOpts().DelayedTemplateParsing = false;
14001396
// Setup code completion.
14011397
FrontendOpts.CodeCompleteOpts = Options;
14021398
FrontendOpts.CodeCompletionAt.FileName = std::string(Input.FileName);

clang-tools-extra/clangd/ParsedAST.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -431,10 +431,6 @@ ParsedAST::build(llvm::StringRef Filename, const ParseInputs &Inputs,
431431
const PrecompiledPreamble *PreamblePCH =
432432
Preamble ? &Preamble->Preamble : nullptr;
433433

434-
// This is on-by-default in windows to allow parsing SDK headers, but it
435-
// breaks many features. Disable it for the main-file (not preamble).
436-
CI->getLangOpts().DelayedTemplateParsing = false;
437-
438434
std::vector<std::unique_ptr<FeatureModule::ASTListener>> ASTListeners;
439435
if (Inputs.FeatureModules) {
440436
for (auto &M : *Inputs.FeatureModules) {

clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3953,8 +3953,8 @@ TEST(CompletionTest, DelayedTemplateParsing) {
39533953
template <typename T> int foo() { return xx^; }
39543954
)cpp");
39553955
auto TU = TestTU::withCode(Test.code());
3956-
// Even though delayed-template-parsing is on, we will disable it to provide
3957-
// completion in templates.
3956+
// We provide completion in templates even when delayed-template-parsing
3957+
// is on.
39583958
TU.ExtraArgs.push_back("-fdelayed-template-parsing");
39593959

39603960
EXPECT_THAT(completions(TU, Test.point()).Completions,

clang-tools-extra/clangd/unittests/ParsedASTTests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ TEST(ParsedASTTest,
203203
AllOf(declNamed("foo"), withTemplateArgs("<bool>"))}));
204204
}
205205

206-
TEST(ParsedASTTest, IgnoresDelayedTemplateParsing) {
206+
TEST(ParsedASTTest, WorksEvenWithDelayedTemplateParsing) {
207207
auto TU = TestTU::withCode(R"cpp(
208208
template <typename T> void xxx() {
209209
int yyy = 0;

clang-tools-extra/clangd/unittests/RenameTests.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1382,7 +1382,6 @@ TEST(RenameTest, Renameable) {
13821382
SCOPED_TRACE(Case.Code);
13831383
Annotations T(Case.Code);
13841384
TestTU TU = TestTU::withCode(T.code());
1385-
TU.ExtraArgs.push_back("-fno-delayed-template-parsing");
13861385
if (Case.IsHeaderFile) {
13871386
// We open the .h file as the main file.
13881387
TU.Filename = "test.h";

clang-tools-extra/clangd/unittests/XRefsTests.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,9 +1418,6 @@ TEST(LocateSymbol, Ambiguous) {
14181418
}
14191419
)cpp");
14201420
auto TU = TestTU::withCode(T.code());
1421-
// FIXME: Go-to-definition in a template requires disabling delayed template
1422-
// parsing.
1423-
TU.ExtraArgs.push_back("-fno-delayed-template-parsing");
14241421
auto AST = TU.build();
14251422
// Ordered assertions are deliberate: we expect a predictable order.
14261423
EXPECT_THAT(locateSymbolAt(AST, T.point("1")), ElementsAre(sym("str")));

clang-tools-extra/unittests/clang-tidy/ClangTidyTest.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ runCheckOnCode(StringRef Code, std::vector<ClangTidyError> *Errors = nullptr,
104104

105105
std::vector<std::string> Args(1, "clang-tidy");
106106
Args.push_back("-fsyntax-only");
107-
Args.push_back("-fno-delayed-template-parsing");
108107
std::string extension(
109108
std::string(llvm::sys::path::extension(Filename.str())));
110109
if (extension == ".m" || extension == ".mm") {

0 commit comments

Comments
 (0)