Compile fix with recent Qt dev

The reasoning in 1b4766e26c 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>
This commit is contained in:
hjk
2019-07-24 13:43:54 +02:00
parent 02e224fcfa
commit e3b1106afa
70 changed files with 238 additions and 491 deletions

View File

@@ -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;