Skip to content

Commit 8ee9d3d

Browse files
committed
Nit
1 parent e18b7ba commit 8ee9d3d

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

lib/symboldatabase.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2555,8 +2555,6 @@ Function::Function(const Token *tok,
25552555
if (::isOperator(tokenDef)) {
25562556
isOperator(true);
25572557

2558-
isExplicit(tokenDef->strAt(-1) == "explicit" || tokenDef->strAt(-2) == "explicit");
2559-
25602558
// 'operator =' is special
25612559
if (tokenDef->str() == "operator=")
25622560
type = FunctionType::eOperatorEqual;
@@ -2580,8 +2578,6 @@ Function::Function(const Token *tok,
25802578
// constructor of any kind
25812579
else
25822580
type = FunctionType::eConstructor;
2583-
2584-
isExplicit(tokenDef->strAt(-1) == "explicit" || tokenDef->strAt(-2) == "explicit");
25852581
}
25862582

25872583
const Token *tok1 = setFlags(tok, scope);
@@ -2655,6 +2651,12 @@ Function::Function(const Token *tok,
26552651
isInline(true);
26562652
hasBody(true);
26572653
}
2654+
2655+
for (tok = tokenDef->previous(); Token::Match(tok, "&|&&|*|::|)|[|(|]|%name%"); tok = tok->previous()) {
2656+
// We should set other keywords here as well
2657+
if (tok->str() == "explicit")
2658+
isExplicit(true);
2659+
}
26582660
}
26592661

26602662
Function::Function(const Token *tokenDef, const std::string &clangType)

0 commit comments

Comments
 (0)