Fixed Tokenizer::setVarId when removing last scope name

This commit is contained in:
Daniel Marjamäki 2020-12-08 17:39:04 +01:00
parent 245284acde
commit d340e8770c
1 changed files with 4 additions and 2 deletions

View File

@ -3838,9 +3838,11 @@ void Tokenizer::setVarIdPass2()
baseClassName = name;
break;
}
if (scopeName3.size() < 8)
// Remove last scope name
if (scopeName3.size() <= 8)
break;
const std::string::size_type pos = scopeName3.rfind(" :: ", scopeName.size()-5);
scopeName3.erase(scopeName3.size() - 4);
const std::string::size_type pos = scopeName3.rfind(" :: ");
if (pos == std::string::npos)
break;
scopeName3.erase(pos + 4);