Commit b32ff7b3 authored by ussrhero's avatar ussrhero

fixed expression evaluator: template with wchar_t argument

parent 66861991
......@@ -1077,6 +1077,12 @@ std::string TypeEval::getTypeName(const parser::QualifiedTypeMatcher& typeMatche
typeName = typeMatcher.getBaseTypeMatcher().getTypeName();
}
else
if (typeMatcher.isStandardIntType())
{
auto& token = typeMatcher.getStandardIntMatcher().getMatchResult().begin();
typeName = std::string(token->getIdentifierInfo()->getNameStart(), token->getLength());
}
else
if (typeMatcher.isCustomType())
{
typeName = getCustomTypeName(typeMatcher.getCustomMatcher());
......
......@@ -567,3 +567,17 @@ TEST(TypeEvalTest, getTempalteArgs)
EXPECT_EQ(L"long *const", type->getTemplateArg(2));
}
TEST(TypeEvalTest, TemplateWcharT)
{
static const char sourceCode[] = " \
template<typename T1, typename ...> \
struct TestStruct { \
}; \
TestStruct<wchar_t> testVal1; \
";
TypeInfoProviderPtr typeProvider = getTypeInfoProviderFromSource(sourceCode);
EXPECT_EQ(L"TestStruct<wchar_t>", evalType("TestStruct<wchar_t>", typeProvider)->getName());
}
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