Commit 22f3f7d0 authored by ussrhero's avatar ussrhero

bug fix #33

parent ef6dd498
......@@ -401,7 +401,8 @@ public:
int m_member;
};
static const long m_constLong = 30;
private:
nestedClass m_nestedMember;
......@@ -410,7 +411,7 @@ private:
extern testClass1 g_testClass;
static const int constInt = 789;
}
////////////////////////////////////////////////////////////////////////////////
......@@ -425,5 +426,17 @@ extern testStructZeroArray *g_testStructZeroArray;
////////////////////////////////////////////////////////////////////////////////
template<class T>
struct TemplateStruct {
T field;
};
extern TemplateStruct<int> g_template1;
extern TemplateStruct<void *> g_template2;
extern TemplateStruct<TemplateStruct<bool>> g_template3;
extern TemplateStruct<TemplateStruct<int>[4]> g_template4;
////////////////////////////////////////////////////////////////////////////////
#pragma pack ( pop )
......@@ -552,8 +552,8 @@ bool TypeInfo::isBaseType( const std::wstring &typeName )
if ( isComplexType(name) )
{
name = getTypeNameFromComplex(name);
if ( name.empty() )
throw TypeException( typeName, L"invalid type name" );
if (name.empty())
return false;
}
boost::wsmatch baseMatchResult;
......
......@@ -209,3 +209,9 @@ public:
};
testStructZeroArrayInter g_testStructZeroArrayInter;
TemplateStruct<int> g_template1;
TemplateStruct<void *> g_template2;
TemplateStruct<TemplateStruct<bool>> g_template3;
TemplateStruct<TemplateStruct<int>[4]> g_template4;
\ No newline at end of file
......@@ -622,4 +622,12 @@ TEST_F(TypeInfoTest, PdbProviderEnum)
EXPECT_EQ(12, count);
}
TEST_F(TypeInfoTest, TemplateStruct)
{
EXPECT_EQ(5, m_targetModule->enumTypes(L"TemplateStruct*").size());
EXPECT_EQ(L"TemplateStruct<int>", loadType(L"TemplateStruct<int>")->getName());
EXPECT_EQ(L"TemplateStruct<void *>", loadType(L"TemplateStruct<void *>")->getName());
EXPECT_EQ(L"TemplateStruct<TemplateStruct<bool> >", loadType(L"TemplateStruct<TemplateStruct<bool> >")->getName());
EXPECT_EQ(L"TemplateStruct<TemplateStruct<int> [4]>", loadType(L"TemplateStruct<TemplateStruct<int> [4]>")->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