C++: handle braced return statements in indenter.

Task-number: QTCREATORBUG-9314

Change-Id: I59c026cce02b85eeb54f4d10d5c9fb0c59bfe28a
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
Erik Verbruggen
2013-05-27 11:54:50 +02:00
committed by Nikolai Kosjar
parent db4a8caf32
commit 6d544bc2ca
2 changed files with 16 additions and 0 deletions

View File

@@ -126,6 +126,7 @@ private Q_SLOTS:
void blockBraces1();
void functionDefaultArgument();
void attributeInAccessSpecifier();
void braceReturn();
};
struct Line {
@@ -2097,6 +2098,19 @@ void tst_CodeFormatter::attributeInAccessSpecifier()
checkIndent(data);
}
void tst_CodeFormatter::braceReturn()
{
QList<Line> data;
data << Line("class X {")
<< Line(" void the_answer() {")
<< Line(" return {42};")
<< Line(" }")
<< Line(" int x;")
<< Line("};")
;
checkIndent(data);
}
QTEST_MAIN(tst_CodeFormatter)
#include "tst_codeformatter.moc"