summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppcodeformatter.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2020-06-03 16:26:59 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2020-06-04 07:21:39 +0000
commit02f2841a4176d82d025fc25343f3d4eb6754a9e0 (patch)
treeb6bbc5f3dce5ad80ce41e6eb577f84d6f3e70020 /src/plugins/cpptools/cppcodeformatter.cpp
parent9e08ecb816471ecbdbcb0e8abbf639c61e6c0428 (diff)
downloadqt-creator-02f2841a4176d82d025fc25343f3d4eb6754a9e0.tar.gz
CppTools: Fix formatting for new-style function declaration
Fixes: QTCREATORBUG-23502 Change-Id: Ie80fe9aa77ffbf0b9ecc531841e78f2bd80de37e Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Diffstat (limited to 'src/plugins/cpptools/cppcodeformatter.cpp')
-rw-r--r--src/plugins/cpptools/cppcodeformatter.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cppcodeformatter.cpp b/src/plugins/cpptools/cppcodeformatter.cpp
index 6925b711c8..d98b0022ec 100644
--- a/src/plugins/cpptools/cppcodeformatter.cpp
+++ b/src/plugins/cpptools/cppcodeformatter.cpp
@@ -199,6 +199,11 @@ void CodeFormatter::recalculateStateAfter(const QTextBlock &block)
turnInto(substatement_open);
}
break;
+ case T_ARROW: // Trailing return type?
+ if (m_currentState.at(m_currentState.size() - 2).type == declaration_start) {
+ leave();
+ break;
+ }
default: tryExpression(); break;
} break;