CppTools: Fix formatting for new-style function declaration

Fixes: QTCREATORBUG-23502
Change-Id: Ie80fe9aa77ffbf0b9ecc531841e78f2bd80de37e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Christian Kandeler
2020-06-03 16:26:59 +02:00
parent 9e08ecb816
commit 02f2841a41
2 changed files with 6 additions and 0 deletions

View File

@@ -199,6 +199,11 @@ void CodeFormatter::recalculateStateAfter(const QTextBlock &block)
turnInto(substatement_open);
}
break;
case T_ARROW: // Trailing return type?
if (m_currentState.at(m_currentState.size() - 2).type == declaration_start) {
leave();
break;
}
default: tryExpression(); break;
} break;