forked from qt-creator/qt-creator
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:
committed by
Nikolai Kosjar
parent
db4a8caf32
commit
6d544bc2ca
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user