From c76d59d8ff564f918833c97caede7dce2d8cfe60 Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Wed, 29 May 2013 14:09:17 +0000 Subject: [PATCH] Add return missing in r182855. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182856 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Format/UnwrappedLineParser.cpp | 1 + unittests/Format/FormatTest.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/lib/Format/UnwrappedLineParser.cpp b/lib/Format/UnwrappedLineParser.cpp index 316d324f7a..3b72bef601 100644 --- a/lib/Format/UnwrappedLineParser.cpp +++ b/lib/Format/UnwrappedLineParser.cpp @@ -601,6 +601,7 @@ void UnwrappedLineParser::parseStructuralElement() { Text == Text.upper()) { // Recognize free-standing macros like Q_OBJECT. addUnwrappedLine(); + return; } } break; diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index eacd189840..18a1a00858 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -1702,6 +1702,14 @@ TEST_F(FormatTest, MacrosWithoutTrailingSemicolon) { "\n" " A() {\n}\n" "} ;")); + EXPECT_EQ("SOME_MACRO\n" + "namespace {\n" + "void f();\n" + "}", + format("SOME_MACRO\n" + " namespace {\n" + "void f( );\n" + "}")); // Only if the identifier contains at least 5 characters. EXPECT_EQ("HTTP f();", format("HTTP\nf();")); -- 2.40.0