diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2016-12-02 23:52:22 -0800 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2016-12-04 07:40:48 +0000 |
commit | a0fd2539154dafdd512bf634658e361ca56d3004 (patch) | |
tree | 270b3733791e2a64081a0bf410bf3681db013598 /src | |
parent | a63e6ea1ccae744ed40d00aac97c4ce46e7ac6d4 (diff) |
Fix compilation error with ICC 17: it doesn't like auto and comma
The error is a warning upgraded via -Werror and the message doesn't even
make sense to me:
error #3373: nonstandard use of "auto" to both deduce the type from an
initializer and to announce a trailing return type
Intel-Issue-ID: 6000164202
Change-Id: I73fa1e59a4844c43a109fffd148caf09a1952e92
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/compiler/qqmlpropertycachecreator_p.h | 56 | ||||
-rw-r--r-- | src/qml/compiler/qv4compileddata_p.h | 8 |
2 files changed, 48 insertions, 16 deletions
diff --git a/src/qml/compiler/qqmlpropertycachecreator_p.h b/src/qml/compiler/qqmlpropertycachecreator_p.h index 10bcd1dbc1..3c14abc019 100644 --- a/src/qml/compiler/qqmlpropertycachecreator_p.h +++ b/src/qml/compiler/qqmlpropertycachecreator_p.h @@ -118,7 +118,9 @@ inline QQmlCompileError QQmlPropertyCacheCreator<ObjectContainer>::buildMetaObje bool needVMEMetaObject = obj->propertyCount() != 0 || obj->aliasCount() != 0 || obj->signalCount() != 0 || obj->functionCount() != 0; if (!needVMEMetaObject) { - for (auto binding = obj->bindingsBegin(), end = obj->bindingsEnd(); binding != end; ++binding) { + auto binding = obj->bindingsBegin(); + auto end = obj->bindingsEnd(); + for ( ; binding != end; ++binding) { if (binding->type == QV4::CompiledData::Binding::Type_Object && (binding->flags & QV4::CompiledData::Binding::IsOnAssignment)) { // If the on assignment is inside a group property, we need to distinguish between QObject based // group properties and value type group properties. For the former the base type is derived from @@ -162,7 +164,9 @@ inline QQmlCompileError QQmlPropertyCacheCreator<ObjectContainer>::buildMetaObje } if (QQmlPropertyCache *thisCache = propertyCaches->at(objectIndex)) { - for (auto binding = obj->bindingsBegin(), end = obj->bindingsEnd(); binding != end; ++binding) + auto binding = obj->bindingsBegin(); + auto end = obj->bindingsEnd(); + for ( ; binding != end; ++binding) if (binding->type >= QV4::CompiledData::Binding::Type_Object) { QQmlBindingInstantiationContext context(objectIndex, &(*binding), stringAt(binding->propertyNameIndex), thisCache); QQmlCompileError error = buildMetaObjectRecursively(binding->value.objectIndex, context); @@ -296,7 +300,9 @@ inline QQmlCompileError QQmlPropertyCacheCreator<ObjectContainer>::createMetaObj QmlIR::PropertyResolver resolver(baseTypeCache); - for (auto p = obj->propertiesBegin(), end = obj->propertiesEnd(); p != end; ++p) { + auto p = obj->propertiesBegin(); + auto pend = obj->propertiesEnd(); + for ( ; p != pend; ++p) { if (p->type == QV4::CompiledData::Property::Var) varPropCount++; @@ -306,7 +312,9 @@ inline QQmlCompileError QQmlPropertyCacheCreator<ObjectContainer>::createMetaObj return QQmlCompileError(p->location, QQmlPropertyCacheCreatorBase::tr("Cannot override FINAL property")); } - for (auto a = obj->aliasesBegin(), end = obj->aliasesEnd(); a != end; ++a) { + auto a = obj->aliasesBegin(); + auto aend = obj->aliasesEnd(); + for ( ; a != aend; ++a) { bool notInRevision = false; QQmlPropertyData *d = resolver.property(stringAt(a->nameIndex), ¬InRevision); if (d && d->isFinal()) @@ -340,7 +348,9 @@ inline QQmlCompileError QQmlPropertyCacheCreator<ObjectContainer>::createMetaObj } // Set up notify signals for properties - first normal, then alias - for (auto p = obj->propertiesBegin(), end = obj->propertiesEnd(); p != end; ++p) { + p = obj->propertiesBegin(); + pend = obj->propertiesEnd(); + for ( ; p != pend; ++p) { auto flags = QQmlPropertyData::defaultSignalFlags(); QString changedSigName = stringAt(p->nameIndex) + QLatin1String("Changed"); @@ -349,7 +359,9 @@ inline QQmlCompileError QQmlPropertyCacheCreator<ObjectContainer>::createMetaObj cache->appendSignal(changedSigName, flags, effectiveMethodIndex++); } - for (auto a = obj->aliasesBegin(), end = obj->aliasesEnd(); a != end; ++a) { + a = obj->aliasesBegin(); + aend = obj->aliasesEnd(); + for ( ; a != aend; ++a) { auto flags = QQmlPropertyData::defaultSignalFlags(); QString changedSigName = stringAt(a->nameIndex) + QLatin1String("Changed"); @@ -359,7 +371,9 @@ inline QQmlCompileError QQmlPropertyCacheCreator<ObjectContainer>::createMetaObj } // Dynamic signals - for (auto s = obj->signalsBegin(), end = obj->signalsEnd(); s != end; ++s) { + auto s = obj->signalsBegin(); + auto send = obj->signalsEnd(); + for ( ; s != send; ++s) { const int paramCount = s->parameterCount(); QList<QByteArray> names; @@ -370,7 +384,9 @@ inline QQmlCompileError QQmlPropertyCacheCreator<ObjectContainer>::createMetaObj paramTypes[0] = paramCount; int i = 0; - for (auto param = s->parametersBegin(), end = s->parametersEnd(); param != end; ++param, ++i) { + auto param = s->parametersBegin(); + auto end = s->parametersEnd(); + for ( ; param != end; ++param, ++i) { names.append(stringAt(param->nameIndex).toUtf8()); if (param->type < builtinTypeCount) { // built-in type @@ -415,7 +431,9 @@ inline QQmlCompileError QQmlPropertyCacheCreator<ObjectContainer>::createMetaObj // Dynamic slots - for (auto function = objectContainer->objectFunctionsBegin(obj), end = objectContainer->objectFunctionsEnd(obj); function != end; ++function) { + auto function = objectContainer->objectFunctionsBegin(obj); + auto fend = objectContainer->objectFunctionsEnd(obj); + for ( ; function != fend; ++function) { auto flags = QQmlPropertyData::defaultSlotFlags(); const QString slotName = stringAt(function->nameIndex); @@ -425,7 +443,9 @@ inline QQmlCompileError QQmlPropertyCacheCreator<ObjectContainer>::createMetaObj // protect against overriding change signals or methods with properties. QList<QByteArray> parameterNames; - for (auto formal = function->formalsBegin(), end = function->formalsEnd(); formal != end; ++formal) { + auto formal = function->formalsBegin(); + auto end = function->formalsEnd(); + for ( ; formal != end; ++formal) { flags.hasArguments = true; parameterNames << stringAt(*formal).toUtf8(); } @@ -437,7 +457,9 @@ inline QQmlCompileError QQmlPropertyCacheCreator<ObjectContainer>::createMetaObj // Dynamic properties int effectiveSignalIndex = cache->signalHandlerIndexCacheStart; int propertyIdx = 0; - for (auto p = obj->propertiesBegin(), end = obj->propertiesEnd(); p != end; ++p, ++propertyIdx) { + p = obj->propertiesBegin(); + pend = obj->propertiesEnd(); + for ( ; p != pend; ++p, ++propertyIdx) { int propertyType = 0; QQmlPropertyData::Flags propertyFlags; @@ -561,7 +583,9 @@ inline void QQmlPropertyCacheAliasCreator<ObjectContainer>::appendAliasPropertie return; const auto allAliasTargetsExist = [this, &component](const CompiledObject &object) { - for (auto alias = object.aliasesBegin(), end = object.aliasesEnd(); alias != end; ++alias) { + auto alias = object.aliasesBegin(); + auto end = object.aliasesEnd(); + for ( ; alias != end; ++alias) { Q_ASSERT(alias->flags & QV4::CompiledData::Alias::Resolved); const int targetObjectIndex = objectForId(component, alias->targetObjectId); @@ -612,7 +636,9 @@ inline void QQmlPropertyCacheAliasCreator<ObjectContainer>::collectObjectsWithAl if (object.flags & QV4::CompiledData::Object::IsComponent && objectIndex != objectContainer->rootObjectIndex()) return; - for (auto binding = object.bindingsBegin(), end = object.bindingsEnd(); binding != end; ++binding) { + auto binding = object.bindingsBegin(); + auto end = object.bindingsEnd(); + for (; binding != end; ++binding) { if (binding->type != QV4::CompiledData::Binding::Type_Object && binding->type != QV4::CompiledData::Binding::Type_AttachedProperty && binding->type != QV4::CompiledData::Binding::Type_GroupProperty) @@ -707,7 +733,9 @@ inline void QQmlPropertyCacheAliasCreator<ObjectContainer>::appendAliasesToPrope int effectivePropertyIndex = propertyCache->propertyIndexCacheStart + propertyCache->propertyIndexCache.count(); int aliasIndex = 0; - for (auto alias = object.aliasesBegin(), end = object.aliasesEnd(); alias != end; ++alias, ++aliasIndex) { + auto alias = object.aliasesBegin(); + auto end = object.aliasesEnd(); + for ( ; alias != end; ++alias, ++aliasIndex) { Q_ASSERT(alias->flags & QV4::CompiledData::Alias::Resolved); int type = 0; diff --git a/src/qml/compiler/qv4compileddata_p.h b/src/qml/compiler/qv4compileddata_p.h index 90cbe04505..3a0c83ddad 100644 --- a/src/qml/compiler/qv4compileddata_p.h +++ b/src/qml/compiler/qv4compileddata_p.h @@ -749,7 +749,9 @@ struct TypeReferenceMap : QHash<int, TypeReference> r.errorWhenNotFound = true; } - for (auto prop = obj->propertiesBegin(), propEnd = obj->propertiesEnd(); prop != propEnd; ++prop) { + auto prop = obj->propertiesBegin(); + auto propEnd = obj->propertiesEnd(); + for ( ; prop != propEnd; ++prop) { if (prop->type >= QV4::CompiledData::Property::Custom) { // ### FIXME: We could report the more accurate location here by using prop->location, but the old // compiler can't and the tests expect it to be the object location right now. @@ -758,7 +760,9 @@ struct TypeReferenceMap : QHash<int, TypeReference> } } - for (auto binding = obj->bindingsBegin(), bindingEnd = obj->bindingsEnd(); binding != bindingEnd; ++binding) { + auto binding = obj->bindingsBegin(); + auto bindingEnd = obj->bindingsEnd(); + for ( ; binding != bindingEnd; ++binding) { if (binding->type == QV4::CompiledData::Binding::Type_AttachedProperty) this->add(binding->propertyNameIndex, binding->location); } |