C++ indenter: Fix for use of << and >> in parentheses.

Task-number: QTCREATORBUG-4076
This commit is contained in:
Christian Kamm
2011-03-15 15:05:05 +01:00
parent 4fa528813e
commit faff0c8ace
2 changed files with 20 additions and 1 deletions

View File

@@ -71,6 +71,7 @@ private Q_SLOTS:
void braceList();
void bug1();
void bug2();
void bug3();
void switch1();
void memberInitializer();
void templates();
@@ -669,6 +670,23 @@ void tst_CodeFormatter::bug2()
checkIndent(data);
}
void tst_CodeFormatter::bug3()
{
QList<Line> data;
data << Line("class AutoAttack")
<< Line("{")
<< Line("public:")
<< Line(" AutoAttack(unsigned delay, unsigned warmup)")
<< Line(" ~ : mWarmup(warmup && warmup < delay ? warmup : delay >> 2)")
<< Line(" {}")
<< Line(" unsigned getWarmup() const { return mWarmup; }")
<< Line("private:")
<< Line(" unsigned mWarmup;")
<< Line("}")
;
checkIndent(data);
}
void tst_CodeFormatter::braceList()
{
QList<Line> data;