forked from qt-creator/qt-creator
C++ indenter: Fix indentation if template and class appear on one line.
Task-number: QTCREATORBUG-2427
This commit is contained in:
@@ -48,6 +48,7 @@ private Q_SLOTS:
|
||||
void blockStmtInIf();
|
||||
void nestedInitializer();
|
||||
void forStatement();
|
||||
void templateSingleline();
|
||||
};
|
||||
|
||||
struct Line {
|
||||
@@ -939,6 +940,18 @@ void tst_CodeFormatter::forStatement()
|
||||
checkIndent(data);
|
||||
}
|
||||
|
||||
void tst_CodeFormatter::templateSingleline()
|
||||
{
|
||||
QList<Line> data;
|
||||
data
|
||||
<< Line("template <typename T> class Foo")
|
||||
<< Line("{")
|
||||
<< Line(" T t;")
|
||||
<< Line("}")
|
||||
;
|
||||
checkIndent(data);
|
||||
}
|
||||
|
||||
QTEST_APPLESS_MAIN(tst_CodeFormatter)
|
||||
#include "tst_codeformatter.moc"
|
||||
|
||||
|
Reference in New Issue
Block a user