C++ indenter: Fix extra specifier in return type of func decl.

Like
struct Foo bar() { }

Change-Id: I946937c23d1660909757952a5a3bd400c4781826
Reviewed-on: http://codereview.qt.nokia.com/13
Reviewed-by: Erik Verbruggen <erik.verbruggen@nokia.com>
This commit is contained in:
Christian Kamm
2011-05-19 13:06:49 +02:00
parent b0d093b0d7
commit 86d5df063c
2 changed files with 16 additions and 0 deletions

View File

@@ -91,6 +91,7 @@ private Q_SLOTS:
void whitesmithsStyleSwitch();
void indentToNextToken();
void labels();
void functionsWithExtraSpecifier();
};
struct Line {
@@ -1178,6 +1179,19 @@ void tst_CodeFormatter::labels()
checkIndent(data);
}
void tst_CodeFormatter::functionsWithExtraSpecifier()
{
QList<Line> data;
data << Line("extern void foo() {}")
<< Line("struct Foo bar() {}")
<< Line("enum Foo bar() {}")
<< Line("namespace foo {")
<< Line("}")
<< Line("int a;")
;
checkIndent(data);
}
QTEST_APPLESS_MAIN(tst_CodeFormatter)
#include "tst_codeformatter.moc"