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 | 31343832e708c5db2fc7bfc562d343dcee8f156b (patch) | |
| tree | 718a4a5460ff8d51d25f46d4f00264f5ce2dd1cf | |
| parent | 57d070e6fd1a8d97501ff72956164cebb84aa04d (diff) | |
| download | bcm5719-llvm-31343832e708c5db2fc7bfc562d343dcee8f156b.tar.gz bcm5719-llvm-31343832e708c5db2fc7bfc562d343dcee8f156b.zip | |
clang-format: Fix incorrect detection of QT-signals access specifier.
Before:
void f() {
label:
signals
.baz();
}
After:
void f() {
label:
signals.baz();
}
llvm-svn: 276854
| -rw-r--r-- | clang/lib/Format/UnwrappedLineParser.cpp | 2 | ||||
| -rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp index 2fe72987bc7..9f79ba60f39 100644 --- a/clang/lib/Format/UnwrappedLineParser.cpp +++ b/clang/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/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 8d46ba6efcf..a3e4d3edfff 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/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) { |

