Fix parsing linkage specifier from global function declaration
Our very own "tools/dmake.cpp" had a function declaration featuring "static void foobar()" while the function implementation did not have the 'static' keyword (which is perfectly legal code).
This commit is contained in:
parent
965775423b
commit
374af15bd4
|
@ -1619,8 +1619,14 @@ Function* SymbolDatabase::addGlobalFunctionDecl(Scope*& scope, const Token *tok,
|
|||
tok1 = tok1->previous();
|
||||
|
||||
// find the return type
|
||||
while (tok1 && Token::Match(tok1, "static|extern|const"))
|
||||
while (tok1 && Token::Match(tok1, "static|extern|const")) {
|
||||
if (tok1->str() == "static")
|
||||
function.isStaticLocal(true);
|
||||
else if (tok1->str() == "extern")
|
||||
function.isExtern(true);
|
||||
|
||||
tok1 = tok1->next();
|
||||
}
|
||||
|
||||
if (tok1)
|
||||
function.retDef = tok1;
|
||||
|
|
Loading…
Reference in New Issue