mirror of
https://github.com/pocoproject/poco.git
synced 2025-01-19 08:46:41 +01:00
fixed a namespace lookup bug
This commit is contained in:
parent
2de97f7ef4
commit
5aa942baed
@ -215,7 +215,12 @@ const Token* Parser::parseNameSpace(const Token* pNext)
|
|||||||
std::string name = pNext->tokenString();
|
std::string name = pNext->tokenString();
|
||||||
pNext = next();
|
pNext = next();
|
||||||
expectOperator(pNext, OperatorToken::OP_OPENBRACE, "{");
|
expectOperator(pNext, OperatorToken::OP_OPENBRACE, "{");
|
||||||
NameSpace* pNS = dynamic_cast<NameSpace*>(currentNameSpace()->lookup(name));
|
|
||||||
|
std::string fullName = currentNameSpace()->fullName();
|
||||||
|
if (!fullName.empty()) fullName += "::";
|
||||||
|
fullName += name;
|
||||||
|
|
||||||
|
NameSpace* pNS = dynamic_cast<NameSpace*>(currentNameSpace()->lookup(fullName));
|
||||||
bool undefined = (pNS == 0);
|
bool undefined = (pNS == 0);
|
||||||
if (undefined) pNS = new NameSpace(name, currentNameSpace());
|
if (undefined) pNS = new NameSpace(name, currentNameSpace());
|
||||||
pushNameSpace(pNS, -1, undefined);
|
pushNameSpace(pNS, -1, undefined);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user