From 988fb7ba66b1c9ab014de625b5037203b3516495 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 2 Dec 2016 23:40:33 -0800 Subject: 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: Thiago Macieira --- src/xmlpatterns/schema/qxsdstatemachine_tpl_p.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/xmlpatterns/schema/qxsdstatemachine_tpl_p.h b/src/xmlpatterns/schema/qxsdstatemachine_tpl_p.h index 2583bb9..1cb2e72 100644 --- a/src/xmlpatterns/schema/qxsdstatemachine_tpl_p.h +++ b/src/xmlpatterns/schema/qxsdstatemachine_tpl_p.h @@ -111,7 +111,9 @@ template void XsdStateMachine::reset() { // reset the machine to the start state - for (auto it = m_states.cbegin(), end = m_states.cend(); it != end; ++it) { + auto it = m_states.cbegin(); + auto end = m_states.cend(); + for ( ; it != end; ++it) { if (it.value() == StartState || it.value() == StartEndState) { m_currentState = it.key(); return; @@ -175,7 +177,9 @@ bool XsdStateMachine::proceed(InputType input) // fetch the transition entry for the current state const QHash > &entry = m_transitions[m_currentState]; - for (auto it = entry.cbegin(), end = entry.cend(); it != end; ++it) { + auto it = entry.cbegin(); + auto end = entry.cend(); + for ( ; it != end; ++it) { if (inputEqualsTransition(input, it.key())) { m_currentState = it.value().first(); m_lastTransition = it.key(); @@ -212,7 +216,9 @@ TransitionType XsdStateMachine::lastTransition() const template typename XsdStateMachine::StateId XsdStateMachine::startState() const { - for (auto it = m_states.cbegin(), end = m_states.cend(); it != end; ++it) { + auto it = m_states.cbegin(); + auto end = m_states.cend(); + for ( ; it != end; ++it) { if (it.value() == StartState || it.value() == StartEndState) return it.key(); } @@ -339,7 +345,9 @@ XsdStateMachine XsdStateMachine::toDFA() const // search the start state as the algorithm starts with it... StateId startState = -1; - for (auto it = m_states.cbegin(), end = m_states.cend(); it != end; ++it) { + auto it = m_states.cbegin(); + auto end = m_states.cend(); + for ( ; it != end; ++it) { if (it.value() == StartState) { startState = it.key(); break; -- cgit v1.2.1