From 11a7ccb8651565945c4ca86e7a71412437a97723 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 3 Jul 2020 14:33:05 +0200 Subject: [PATCH] CppEditor: Relax soft assert The look-up results are ordered by precedence and we can just use the first one; there doesn't seem to be a reason that additional results should stop the operation. Fixes: QTCREATORBUG-14531 Change-Id: Ibe12f975f87ae0d526299219ff54492bef34065c Reviewed-by: Christian Stenger --- src/plugins/cppeditor/cppquickfixes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp index 149d1023961..25592086aef 100644 --- a/src/plugins/cppeditor/cppquickfixes.cpp +++ b/src/plugins/cppeditor/cppquickfixes.cpp @@ -5989,7 +5989,7 @@ Class *senderOrReceiverClass(const CppQuickFixInterface &interface, toe.init(interface.semanticInfo().doc, interface.snapshot(), context.bindings()); const QList objectPointerExpressions = toe(objectPointerExpression, objectPointerScope, TypeOfExpression::Preprocess); - QTC_ASSERT(objectPointerExpressions.size() == 1, return nullptr); + QTC_ASSERT(!objectPointerExpressions.isEmpty(), return nullptr); Type *objectPointerTypeBase = objectPointerExpressions.first().type().type(); QTC_ASSERT(objectPointerTypeBase, return nullptr);