summaryrefslogtreecommitdiff
path: root/src/libs/cplusplus
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2019-07-24 13:43:54 +0200
committerhjk <hjk@qt.io>2019-07-29 08:54:18 +0000
commite3b1106afae5de6cd54ce627a0b11be041624591 (patch)
treeaccfac6791013e79476650b6dd840d5cf243e12b /src/libs/cplusplus
parent02e224fcfa7135f1e32adb02a14426ea153ae618 (diff)
downloadqt-creator-e3b1106afae5de6cd54ce627a0b11be041624591.tar.gz
Compile fix with recent Qt dev
The reasoning in 1b4766e26c6b did not take into account that the scope of QT_NO_JAVA_STYLE_ITERATORS may change over time, as done with f70905448f6 in Qt base. Change-Id: Ib1966ff26c4d36d5f62e149d6b45baa4aecf825d Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/libs/cplusplus')
-rw-r--r--src/libs/cplusplus/ResolveExpression.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/libs/cplusplus/ResolveExpression.cpp b/src/libs/cplusplus/ResolveExpression.cpp
index a513a02693..9dbeebc5ea 100644
--- a/src/libs/cplusplus/ResolveExpression.cpp
+++ b/src/libs/cplusplus/ResolveExpression.cpp
@@ -581,18 +581,14 @@ bool ResolveExpression::visit(UnaryExpressionAST *ast)
accept(ast->expression);
unsigned unaryOp = tokenKind(ast->unary_op_token);
if (unaryOp == T_AMPER) {
- QMutableListIterator<LookupItem > it(_results);
- while (it.hasNext()) {
- LookupItem p = it.next();
+ for (LookupItem &p : _results) {
FullySpecifiedType ty = p.type();
ty.setType(control()->pointerType(ty));
p.setType(ty);
- it.setValue(p);
}
} else if (unaryOp == T_STAR) {
- QMutableListIterator<LookupItem > it(_results);
- while (it.hasNext()) {
- LookupItem p = it.next();
+ for (int i = 0; i < _results.size(); ++i) {
+ LookupItem &p = _results[i];
FullySpecifiedType ty = p.type();
NamedType *namedTy = ty->asNamedType();
if (namedTy != 0) {
@@ -603,7 +599,6 @@ bool ResolveExpression::visit(UnaryExpressionAST *ast)
bool added = false;
if (PointerType *ptrTy = ty->asPointerType()) {
p.setType(ptrTy->elementType());
- it.setValue(p);
added = true;
} else if (namedTy != 0) {
const Name *starOp = control()->operatorNameId(OperatorNameId::StarOp);
@@ -616,7 +611,6 @@ bool ResolveExpression::visit(UnaryExpressionAST *ast)
FullySpecifiedType retTy = proto->returnType().simplified();
p.setType(retTy);
p.setScope(proto->enclosingScope());
- it.setValue(p);
added = true;
break;
}
@@ -626,7 +620,7 @@ bool ResolveExpression::visit(UnaryExpressionAST *ast)
}
}
if (!added)
- it.remove();
+ _results.removeAt(i--);
}
}
return false;