Commit a8c858ac authored by Dave Lewis's avatar Dave Lewis Committed by Erik Verbruggen

CppTools: Fix indent after ">>" in return type

Add case for ">>" token in declaration_start state to prevent
falling through to stream_op.

Task-number: QTCREATORBUG-9199
Change-Id: I53710be55eff4574de89f9159e95bbc1de2ba34e
Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@digia.com>
parent 5510ec05
......@@ -189,6 +189,7 @@ void CodeFormatter::recalculateStateAfter(const QTextBlock &block)
case T_LBRACE: enter(defun_open); break;
case T_COLON: enter(member_init_open); enter(member_init_expected); break;
case T_OPERATOR: enter(operator_declaration); break;
case T_GREATER_GREATER: break;
default: tryExpression(true); break;
} break;
......
......@@ -1284,6 +1284,9 @@ void tst_CodeFormatter::functionReturnType()
<< Line("template <class T>")
<< Line("const QList<QMap<T, T> > &")
<< Line("A::B::foo() {}")
<< Line("std::map<int,std::vector<int>> indent() {}")
<< Line("std::map<int,std::vector<int> > indent() {}")
<< Line("")
;
checkIndent(data);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment