Skip to content

Commit

Permalink
Update symboldatabase.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github authored Apr 4, 2024
1 parent e49bd9c commit bcf9c8d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/symboldatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5250,10 +5250,6 @@ const Enumerator * SymbolDatabase::findEnumerator(const Token * tok, std::set<st
return nullptr;

const std::string& tokStr = tok->str();

if (tokensThatAreNotEnumeratorValues.find(tokStr) != tokensThatAreNotEnumeratorValues.end())
return nullptr;

const Scope* scope = tok->scope();

// check for qualified name
Expand Down Expand Up @@ -5314,6 +5310,9 @@ const Enumerator * SymbolDatabase::findEnumerator(const Token * tok, std::set<st
}
} else { // unqualified name

if (tokensThatAreNotEnumeratorValues.find(tokStr) != tokensThatAreNotEnumeratorValues.end())
return nullptr;

if (tok->scope()->type == Scope::eGlobal) {
const Token* astTop = tok->astTop();
if (Token::simpleMatch(astTop, ":") && Token::simpleMatch(astTop->astOperand1(), "(")) { // ctor init list
Expand Down

0 comments on commit bcf9c8d

Please sign in to comment.