We now (since a while) turn this off centrally in ParsedAST and CodeComplete.
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; }
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; }
}
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(
}
TEST_F(TargetDeclTest, DependentExprs) {
- Flags = {"-fno-delayed-template-parsing"};
-
// Heuristic resolution of method of dependent field
Code = R"cpp(
struct A { void foo() {} };
}
TEST_F(TargetDeclTest, DependentTypes) {
- Flags = {"-fno-delayed-template-parsing"};
-
// Heuristic resolution of dependent type name
Code = R"cpp(
template <typename>
// 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++");
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(
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()) {
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();
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)
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();
}
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*); }
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);
}
)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;
}
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;
}
};
)cpp";
- ExtraArgs.push_back("-fno-delayed-template-parsing");
EXPECT_EQ(apply(Test), Expected);
}
}
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"
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;
// 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"));