Commit 5510ec05 authored by Dave Lewis's avatar Dave Lewis Committed by Erik Verbruggen

CppTools: Fix indent after template params

Add case for ">>" token when in template_param state.

Task-number: QTCREATORBUG-9640
Change-Id: Icc5fc868202d6503d2afd954aa739cd2634cdff1
Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@digia.com>
parent 61f18e6f
......@@ -169,6 +169,7 @@ void CodeFormatter::recalculateStateAfter(const QTextBlock &block)
switch (kind) {
case T_LESS: enter(template_param); break;
case T_GREATER: leave(); break;
case T_GREATER_GREATER: leave(); leave(); break; // call leave twice to pop both template_param states
} break;
case operator_declaration:
......
......@@ -1177,6 +1177,8 @@ void tst_CodeFormatter::templates()
<< Line("~ class F, class D>,")
<< Line("~ typename F>")
<< Line("class Foo { };")
<< Line("template <class A = std::vector<int>>")
<< 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