Commit 7435ef44 authored by ussrhero's avatar ussrhero

fixed parser for template with void argument

parent c79f0797
......@@ -1212,6 +1212,11 @@ std::string TypeEval::getCustomTypeName(const parser::CustomTypeMatcher& customM
std::string TypeEval::getBaseTypeName(const parser::BaseTypeMatcher& baseTypeMatcher)
{
if (baseTypeMatcher.getMatchResult().begin()->is(clang::tok::kw_void))
{
return "void";
}
std::unique_ptr<BaseTypeBuilder> baseTypeBuilder(new EmptyBaseTypeBuilder);
for (auto& token : baseTypeMatcher.getMatchResult())
......
......@@ -662,4 +662,9 @@ TEST_F(TypeInfoTest, TemplateArg)
EXPECT_EQ(L"10", loadType(L"TestTemplateTwoValues<2,10>")->getTemplateArg(1));
EXPECT_EQ(L"TestClassTemplate<int>", loadType(L"TestTemplateTwoTypes<int,TestClassTemplate<int> >")->getTemplateArg(1));
EXPECT_THROW(loadType(L"TemplateStruct<int>")->getTemplateArg(1), IndexException);
}
TEST_F(TypeInfoTest, TemplateArgStdPair)
{
EXPECT_EQ(3, loadType(L"g_stdIntList")->getElement(L"_Mypair")->getTemplateArgsCount());
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment