forked from qt-creator/qt-creator
ClangCodeModel: Tighten the check for qualified member function call
Just checking for the base cast is not enough. Change-Id: I455533b7da31cf5c52d8c1b9dd93b3bb2fb58929 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -156,11 +156,15 @@ public:
|
||||
{
|
||||
if (!isMemberFunctionCall())
|
||||
return false;
|
||||
const Utils::optional<QList<AstNode>> childList = children();
|
||||
if (!childList)
|
||||
return true;
|
||||
for (const AstNode &c : qAsConst(*childList)) {
|
||||
if (c.detailIs("UncheckedDerivedToBase"))
|
||||
bool hasBaseCast = false;
|
||||
bool hasRecordType = false;
|
||||
const QList<AstNode> childList = children().value_or(QList<AstNode>());
|
||||
for (const AstNode &c : childList) {
|
||||
if (!hasBaseCast && c.detailIs("UncheckedDerivedToBase"))
|
||||
hasBaseCast = true;
|
||||
if (!hasRecordType && c.role() == "specifier" && c.kind() == "TypeSpec")
|
||||
hasRecordType = true;
|
||||
if (hasBaseCast && hasRecordType)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user