forked from qt-creator/qt-creator
C++: fix indentation for static var decls of anonymous classes.
Task-number: QTCREATORBUG-11392 Change-Id: Ie5dd9014383b639e63653e8abc856fea9e620e49 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
@@ -127,6 +127,7 @@ private Q_SLOTS:
|
||||
void functionDefaultArgument();
|
||||
void attributeInAccessSpecifier();
|
||||
void braceReturn();
|
||||
void staticVarDeclWithTypeDecl();
|
||||
};
|
||||
|
||||
struct Line {
|
||||
@@ -2111,6 +2112,43 @@ void tst_CodeFormatter::braceReturn()
|
||||
checkIndent(data);
|
||||
}
|
||||
|
||||
void tst_CodeFormatter::staticVarDeclWithTypeDecl()
|
||||
{
|
||||
QList<Line> data;
|
||||
data << Line("static class: public Foo {")
|
||||
<< Line("public:")
|
||||
<< Line(" int bar();")
|
||||
<< Line("} mooze;")
|
||||
<< Line("")
|
||||
<< Line("static enum Col {")
|
||||
<< Line(" red,")
|
||||
<< Line(" yellow,")
|
||||
<< Line(" green")
|
||||
<< Line("} Loc;")
|
||||
<< Line("")
|
||||
<< Line("static enum {")
|
||||
<< Line(" red,")
|
||||
<< Line(" yellow,")
|
||||
<< Line(" green")
|
||||
<< Line("} Loc;")
|
||||
<< Line("")
|
||||
<< Line("enum class Col {")
|
||||
<< Line(" red,")
|
||||
<< Line(" yellow,")
|
||||
<< Line(" green")
|
||||
<< Line("};")
|
||||
<< Line("")
|
||||
<< Line("static enum class Col")
|
||||
<< Line("{")
|
||||
<< Line(" red,")
|
||||
<< Line(" yellow,")
|
||||
<< Line(" green")
|
||||
<< Line("} Loc;")
|
||||
<< Line("")
|
||||
;
|
||||
checkIndent(data);
|
||||
}
|
||||
|
||||
QTEST_MAIN(tst_CodeFormatter)
|
||||
|
||||
#include "tst_codeformatter.moc"
|
||||
|
Reference in New Issue
Block a user