parent
c085151eb0
commit
cb02628c7c
|
@ -12019,12 +12019,14 @@ void Tokenizer::simplifyNamespaceAliases()
|
|||
}
|
||||
}
|
||||
|
||||
tok2->str(tokNameStart->str());
|
||||
Token * tok3 = tokNameStart;
|
||||
while (tok3 != tokNameEnd) {
|
||||
tok2->insertToken(tok3->next()->str());
|
||||
tok2 = tok2->next();
|
||||
tok3 = tok3->next();
|
||||
if (tok2->strAt(1) == "::") {
|
||||
tok2->str(tokNameStart->str());
|
||||
Token * tok3 = tokNameStart;
|
||||
while (tok3 != tokNameEnd) {
|
||||
tok2->insertToken(tok3->next()->str());
|
||||
tok2 = tok2->next();
|
||||
tok3 = tok3->next();
|
||||
}
|
||||
}
|
||||
}
|
||||
tok2 = tok2->next();
|
||||
|
|
|
@ -4973,6 +4973,27 @@ private:
|
|||
"}"
|
||||
"namespace AB = A::B;" //duplicate declaration
|
||||
"}"));
|
||||
|
||||
// variable and namespace alias with same name
|
||||
ASSERT_EQUALS("namespace external { namespace ns { "
|
||||
"class A { "
|
||||
"public: "
|
||||
"static void f ( const std :: string & json ) ; "
|
||||
"} ; "
|
||||
"} } "
|
||||
"namespace external { namespace ns { "
|
||||
"void A :: f ( const std :: string & json ) { } "
|
||||
"} }",
|
||||
tok("namespace external::ns {"
|
||||
" class A {"
|
||||
" public:"
|
||||
" static void f(const std::string& json);"
|
||||
" };"
|
||||
"}"
|
||||
"namespace json = rapidjson;"
|
||||
"namespace external::ns {"
|
||||
" void A::f(const std::string& json) { }"
|
||||
"}"));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue