diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2020-06-03 16:26:59 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2020-06-04 07:21:39 +0000 |
commit | 02f2841a4176d82d025fc25343f3d4eb6754a9e0 (patch) | |
tree | b6bbc5f3dce5ad80ce41e6eb577f84d6f3e70020 /src/plugins/cpptools/cppcodeformatter.cpp | |
parent | 9e08ecb816471ecbdbcb0e8abbf639c61e6c0428 (diff) | |
download | qt-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.cpp | 5 |
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; |