From d4c31cef742487fae4f03a4b871872c5e4e08ab1 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 22 May 2020 12:59:08 +0200 Subject: C++: Fix wrong formatting ... when using a shift operator inside an initializer list. Fixes: QTCREATORBUG-16977 Change-Id: I8992162c05345b713c665e3601ae593af5007211 Reviewed-by: Nikolai Kosjar --- src/plugins/cpptools/cppcodeformatter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/cpptools') diff --git a/src/plugins/cpptools/cppcodeformatter.cpp b/src/plugins/cpptools/cppcodeformatter.cpp index 170bf4c61c1..ac7416a6949 100644 --- a/src/plugins/cpptools/cppcodeformatter.cpp +++ b/src/plugins/cpptools/cppcodeformatter.cpp @@ -783,7 +783,7 @@ bool CodeFormatter::tryExpression(bool alsoExpression) newState = stream_op; for (int i = m_currentState.size() - 1; i >= 0; --i) { const int type = m_currentState.at(i).type; - if (type == arglist_open) { // likely a left-shift instead + if (type == arglist_open || type == braceinit_open) { // likely a left-shift instead newState = -1; break; } -- cgit v1.2.3