diff options
author | Daniel Jasper <djasper@google.com> | 2016-07-27 10:13:24 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2016-07-27 10:13:24 +0000 |
commit | 9f35d626bfe6b121766352cfbd3f11bb04232f5b (patch) | |
tree | 32bc1a8c6be2ba769d921b56e51c6a7cdc66be7d | |
parent | 4368b2f937a74d95e211c3b11617c84d864f5d0c (diff) |
clang-format: Fix incorrect detection of QT-signals access specifier.
Before:
void f() {
label:
signals
.baz();
}
After:
void f() {
label:
signals.baz();
}
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@276854 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Format/UnwrappedLineParser.cpp | 2 | ||||
-rw-r--r-- | unittests/Format/FormatTest.cpp | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/Format/UnwrappedLineParser.cpp b/lib/Format/UnwrappedLineParser.cpp index 2fe72987bc..9f79ba60f3 100644 --- a/lib/Format/UnwrappedLineParser.cpp +++ b/lib/Format/UnwrappedLineParser.cpp @@ -906,8 +906,8 @@ void UnwrappedLineParser::parseStructuralElement() { if (FormatTok->is(tok::colon)) { nextToken(); addUnwrappedLine(); + return; } - return; } // In all other cases, parse the declaration. break; diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index 8d46ba6efc..a3e4d3edff 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -1934,6 +1934,10 @@ TEST_F(FormatTest, UnderstandsAccessSpecifiers) { verifyFormat("{\n" " signals.set(); // This needs indentation.\n" "}"); + verifyFormat("void f() {\n" + "label:\n" + " signals.baz();\n" + "}"); } TEST_F(FormatTest, SeparatesLogicalBlocks) { |