Function::isSafe: handle global/namespace functions better
This commit is contained in:
parent
3ec45acc43
commit
753efb4c9b
|
@ -2081,6 +2081,16 @@ const Token * Function::constructorMemberInitialization() const
|
||||||
|
|
||||||
bool Function::isSafe(const Settings *settings) const
|
bool Function::isSafe(const Settings *settings) const
|
||||||
{
|
{
|
||||||
|
if (nestedIn->type == Scope::ScopeType::eGlobal) {
|
||||||
|
if (token->fileIndex() == 0 && isStatic())
|
||||||
|
return settings->safeChecks.internalFunctions;
|
||||||
|
return settings->safeChecks.externalFunctions;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nestedIn->type == Scope::ScopeType::eNamespace) {
|
||||||
|
return token->fileIndex() == 0;
|
||||||
|
}
|
||||||
|
|
||||||
switch (access) {
|
switch (access) {
|
||||||
case AccessControl::Local:
|
case AccessControl::Local:
|
||||||
case AccessControl::Private:
|
case AccessControl::Private:
|
||||||
|
|
Loading…
Reference in New Issue