fix #2943 (Symbol database: Wrong parsing of std::vector as base class.)

This commit is contained in:
Robert Reif 2011-07-27 11:23:22 -04:00
parent 2b48c7624c
commit 54141f2e7f
2 changed files with 21 additions and 0 deletions

View File

@ -1257,6 +1257,9 @@ const Token *SymbolDatabase::initBaseInfo(Scope *scope, const Token *tok)
// add unhandled templates // add unhandled templates
if (tok2->next()->str() == "<") if (tok2->next()->str() == "<")
{ {
tok2 = tok2->next();
base.name += tok2->str();
int level1 = 1; int level1 = 1;
while (tok2->next()) while (tok2->next())
{ {

View File

@ -175,6 +175,7 @@ private:
TEST_CASE(const47); // ticket #2670 TEST_CASE(const47); // ticket #2670
TEST_CASE(const48); // ticket #2672 TEST_CASE(const48); // ticket #2672
TEST_CASE(const49); // ticket #2795 TEST_CASE(const49); // ticket #2795
TEST_CASE(const50); // ticket #2943
TEST_CASE(assigningPointerToPointerIsNotAConstOperation); TEST_CASE(assigningPointerToPointerIsNotAConstOperation);
TEST_CASE(assigningArrayElementIsNotAConstOperation); TEST_CASE(assigningArrayElementIsNotAConstOperation);
TEST_CASE(constoperator1); // operator< can often be const TEST_CASE(constoperator1); // operator< can often be const
@ -5551,6 +5552,23 @@ private:
ASSERT_EQUALS("", errout.str()); ASSERT_EQUALS("", errout.str());
} }
void const50() // ticket 2943
{
checkConst("class Altren\n"
"{\n"
" class SubClass : public std::vector<int>\n"
" {\n"
" };\n"
"};\n"
"void _setAlign()\n"
"{\n"
" if (mTileSize.height > 0) return;\n"
" if (mEmptyView) return;\n"
"}\n");
ASSERT_EQUALS("", errout.str());
}
void assigningPointerToPointerIsNotAConstOperation() void assigningPointerToPointerIsNotAConstOperation()
{ {
checkConst("struct s\n" checkConst("struct s\n"