From: Daniel Jasper Date: Wed, 27 Jul 2016 10:13:24 +0000 (+0000) Subject: clang-format: Fix incorrect detection of QT-signals access specifier. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=31343832e708c5db2fc7bfc562d343dcee8f156b;p=platform%2Fupstream%2Fllvm.git 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 --- diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp index 2fe7298..9f79ba6 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 8d46ba6..a3e4d3e 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) {