forked from qt-creator/qt-creator
C++ indenter: Fix for use of << and >> in parentheses.
Task-number: QTCREATORBUG-4076
This commit is contained in:
@@ -225,8 +225,9 @@ void CodeFormatter::recalculateStateAfter(const QTextBlock &block)
|
||||
else // stream_op_cont already
|
||||
turnInto(stream_op_cont);
|
||||
break;
|
||||
case T_RPAREN:
|
||||
case T_COMMA:
|
||||
case T_SEMICOLON: leave(); continue; // always nested, propagate semicolon
|
||||
case T_SEMICOLON: leave(); continue; // always nested, propagate
|
||||
} break;
|
||||
|
||||
case member_init_open:
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user