diff --git a/cfg/std.cfg b/cfg/std.cfg
index 762c76b30..9760afb7c 100644
--- a/cfg/std.cfg
+++ b/cfg/std.cfg
@@ -8555,6 +8555,13 @@ initializer list (7) string& replace (const_iterator i1, const_iterator i2, init
+
+
+
+ false
+
+
+
malloc
calloc
diff --git a/lib/checkclass.cpp b/lib/checkclass.cpp
index d8c9298af..3afef417d 100644
--- a/lib/checkclass.cpp
+++ b/lib/checkclass.cpp
@@ -2472,8 +2472,9 @@ bool CheckClass::checkConstFunc(const Scope *scope, const Function *func, bool&
;
else if (var->smartPointerType() && var->smartPointerType()->classScope && isConstMemberFunc(var->smartPointerType()->classScope, end)) {
;
- }
- else if (hasOverloadedMemberAccess(end, var->typeScope())) {
+ } else if (var->isSmartPointer() && Token::simpleMatch(tok1->next(), ".") && tok1->next()->originalName().empty() && mSettings->library.isFunctionConst(end)) {
+ ;
+ } else if (hasOverloadedMemberAccess(end, var->typeScope())) {
;
} else if (!var->typeScope() || !isConstMemberFunc(var->typeScope(), end))
return false;
diff --git a/test/cfg/std.cpp b/test/cfg/std.cpp
index fd00d8fc7..7b8e6b02b 100644
--- a/test/cfg/std.cpp
+++ b/test/cfg/std.cpp
@@ -36,6 +36,7 @@
#include
#include
#include