[clangd] Remove redundant -fno-delayed-template-parsing in tests. NFCI
authorSam McCall <sam.mccall@gmail.com>
Wed, 10 Feb 2021 21:20:23 +0000 (22:20 +0100)
committerSam McCall <sam.mccall@gmail.com>
Wed, 10 Feb 2021 21:20:23 +0000 (22:20 +0100)
We now (since a while) turn this off centrally in ParsedAST and CodeComplete.

clang-tools-extra/clangd/unittests/FindTargetTests.cpp
clang-tools-extra/clangd/unittests/ParsedASTTests.cpp
clang-tools-extra/clangd/unittests/RenameTests.cpp
clang-tools-extra/clangd/unittests/SelectionTests.cpp
clang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp
clang-tools-extra/clangd/unittests/XRefsTests.cpp
clang-tools-extra/clangd/unittests/tweaks/DefineInlineTests.cpp
clang-tools-extra/clangd/unittests/tweaks/DefineOutlineTests.cpp
clang-tools-extra/clangd/unittests/tweaks/ExpandAutoTypeTests.cpp

index 1dab9d0..2f69028 100644 (file)
@@ -326,9 +326,6 @@ TEST_F(TargetDeclTest, Types) {
   EXPECT_DECLS("TypedefTypeLoc", {"typedef ns::S X", Rel::Alias},
                {"struct S", Rel::Underlying});
 
-  // FIXME: Auto-completion in a template requires disabling delayed template
-  // parsing.
-  Flags = {"-fno-delayed-template-parsing"};
   Code = R"cpp(
     template<class T>
     void foo() { [[T]] x; }
@@ -336,9 +333,6 @@ TEST_F(TargetDeclTest, Types) {
   EXPECT_DECLS("TemplateTypeParmTypeLoc", "class T");
   Flags.clear();
 
-  // FIXME: Auto-completion in a template requires disabling delayed template
-  // parsing.
-  Flags = {"-fno-delayed-template-parsing"};
   Code = R"cpp(
     template<template<typename> class T>
     void foo() { [[T<int>]] x; }
@@ -615,9 +609,6 @@ TEST_F(TargetDeclTest, Lambda) {
 }
 
 TEST_F(TargetDeclTest, OverloadExpr) {
-  // FIXME: Auto-completion in a template requires disabling delayed template
-  // parsing.
-  Flags = {"-fno-delayed-template-parsing"};
   Flags.push_back("--target=x86_64-pc-linux-gnu");
 
   Code = R"cpp(
@@ -676,8 +667,6 @@ TEST_F(TargetDeclTest, OverloadExpr) {
 }
 
 TEST_F(TargetDeclTest, DependentExprs) {
-  Flags = {"-fno-delayed-template-parsing"};
-
   // Heuristic resolution of method of dependent field
   Code = R"cpp(
         struct A { void foo() {} };
@@ -758,8 +747,6 @@ TEST_F(TargetDeclTest, DependentExprs) {
 }
 
 TEST_F(TargetDeclTest, DependentTypes) {
-  Flags = {"-fno-delayed-template-parsing"};
-
   // Heuristic resolution of dependent type name
   Code = R"cpp(
         template <typename>
@@ -981,7 +968,6 @@ protected:
 
     // FIXME: Auto-completion in a template requires disabling delayed template
     // parsing.
-    TU.ExtraArgs.push_back("-fno-delayed-template-parsing");
     TU.ExtraArgs.push_back("-std=c++20");
     TU.ExtraArgs.push_back("-xobjective-c++");
 
index 98a2483..a732837 100644 (file)
@@ -184,9 +184,6 @@ TEST(ParsedASTTest,
     template <>
     int foo<bool> = 0;
   )cpp";
-  // FIXME: Auto-completion in a template requires disabling delayed template
-  // parsing.
-  TU.ExtraArgs.push_back("-fno-delayed-template-parsing");
 
   auto AST = TU.build();
   EXPECT_THAT(
index f1f9e17..b1cd8bc 100644 (file)
@@ -829,7 +829,6 @@ TEST(RenameTest, WithinFileRename) {
     SCOPED_TRACE(T);
     Annotations Code(T);
     auto TU = TestTU::withCode(Code.code());
-    TU.ExtraArgs.push_back("-fno-delayed-template-parsing");
     TU.ExtraArgs.push_back("-xobjective-c++");
     auto AST = TU.build();
     for (const auto &RenamePos : Code.points()) {
index f187020..e9c689f 100644 (file)
@@ -462,9 +462,6 @@ TEST(SelectionTest, CommonAncestor) {
     TestTU TU;
     TU.Code = std::string(Test.code());
 
-    // FIXME: Auto-completion in a template requires disabling delayed template
-    // parsing.
-    TU.ExtraArgs.push_back("-fno-delayed-template-parsing");
     TU.ExtraArgs.push_back("-xobjective-c++");
 
     auto AST = TU.build();
index 9172486..eb848dd 100644 (file)
@@ -74,9 +74,6 @@ void checkHighlightings(llvm::StringRef Code,
   TestTU TU;
   TU.Code = std::string(Test.code());
 
-  // FIXME: Auto-completion in a template requires disabling delayed template
-  // parsing.
-  TU.ExtraArgs.push_back("-fno-delayed-template-parsing");
   TU.ExtraArgs.push_back("-std=c++20");
 
   for (auto File : AdditionalFiles)
index 06bdb9f..a771590 100644 (file)
@@ -896,9 +896,6 @@ TEST(LocateSymbol, All) {
     TestTU TU;
     TU.Code = std::string(T.code());
 
-    // FIXME: Auto-completion in a template requires disabling delayed template
-    // parsing.
-    TU.ExtraArgs.push_back("-fno-delayed-template-parsing");
     TU.ExtraArgs.push_back("-xobjective-c++");
 
     auto AST = TU.build();
index f190a31..4c1bd3a 100644 (file)
@@ -176,9 +176,6 @@ TEST_F(DefineInlineTest, CheckForCanonDecl) {
 }
 
 TEST_F(DefineInlineTest, UsingShadowDecls) {
-  // Template body is not parsed until instantiation time on windows, which
-  // results in arbitrary failures as function body becomes NULL.
-  ExtraArgs.push_back("-fno-delayed-template-parsing");
   EXPECT_UNAVAILABLE(R"cpp(
   namespace ns1 { void foo(int); }
   namespace ns2 { void foo(int*); }
@@ -426,9 +423,6 @@ TEST_F(DefineInlineTest, TransformDependentTypes) {
     using namespace a;
     )cpp";
 
-  // Template body is not parsed until instantiation time on windows, which
-  // results in arbitrary failures as function body becomes NULL.
-  ExtraArgs.push_back("-fno-delayed-template-parsing");
   EXPECT_EQ(apply(Test), Expected);
 }
 
@@ -512,9 +506,6 @@ TEST_F(DefineInlineTest, TransformFunctionTempls) {
 
           )cpp"},
   };
-  // Template body is not parsed until instantiation time on windows, which
-  // results in arbitrary failures as function body becomes NULL.
-  ExtraArgs.push_back("-fno-delayed-template-parsing");
   for (const auto &Case : Cases)
     EXPECT_EQ(apply(Case.first), Case.second) << Case.first;
 }
@@ -658,7 +649,6 @@ est);
         void foo(PARAM, TYPE b, TYPE c, TYPE d = BODY(x)){}
         )cpp"},
   };
-  ExtraArgs.push_back("-fno-delayed-template-parsing");
   for (const auto &Case : Cases)
     EXPECT_EQ(apply(Case.first), Case.second) << Case.first;
 }
@@ -689,7 +679,6 @@ TEST_F(DefineInlineTest, TransformTemplParamNames) {
     };
 
     )cpp";
-  ExtraArgs.push_back("-fno-delayed-template-parsing");
   EXPECT_EQ(apply(Test), Expected);
 }
 
@@ -936,7 +925,6 @@ TEST_F(DefineInlineTest, QualifyWithUsingDirectives) {
 }
 
 TEST_F(DefineInlineTest, AddInline) {
-  ExtraArgs.push_back("-fno-delayed-template-parsing");
   llvm::StringMap<std::string> EditedFiles;
   ExtraFiles["a.h"] = "void foo();";
   apply(R"cpp(#include "a.h"
index 1a49a37..fa62728 100644 (file)
@@ -99,9 +99,6 @@ TEST_F(DefineOutlineTest, ApplyTest) {
   llvm::StringMap<std::string> EditedFiles;
   ExtraFiles["Test.cpp"] = "";
   FileName = "Test.hpp";
-  // Template body is not parsed until instantiation time on windows, which
-  // results in arbitrary failures as function body becomes NULL.
-  ExtraArgs.push_back("-fno-delayed-template-parsing");
 
   struct {
     llvm::StringRef Test;
index 5554b68..1b784f6 100644 (file)
@@ -74,9 +74,6 @@ TEST_F(ExpandAutoTypeTest, Test) {
   // expanding types in structured bindings is syntactically invalid.
   EXPECT_UNAVAILABLE("const ^auto &[x,y] = (int[]){1,2};");
 
-  // FIXME: Auto-completion in a template requires disabling delayed template
-  // parsing.
-  ExtraArgs.push_back("-fno-delayed-template-parsing");
   // unknown types in a template should not be replaced
   EXPECT_THAT(apply("template <typename T> void x() { ^auto y = T::z(); }"),
               StartsWith("fail: Could not deduce type for 'auto' type"));