]> granicus.if.org Git - clang/commitdiff
Add return missing in r182855.
authorDaniel Jasper <djasper@google.com>
Wed, 29 May 2013 14:09:17 +0000 (14:09 +0000)
committerDaniel Jasper <djasper@google.com>
Wed, 29 May 2013 14:09:17 +0000 (14:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182856 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Format/UnwrappedLineParser.cpp
unittests/Format/FormatTest.cpp

index 316d324f7a4a2f075dd19ae824f6001b0775c2df..3b72bef6012765488972d93819cf85e3ece9a53a 100644 (file)
@@ -601,6 +601,7 @@ void UnwrappedLineParser::parseStructuralElement() {
                    Text == Text.upper()) {
           // Recognize free-standing macros like Q_OBJECT.
           addUnwrappedLine();
+          return;
         }
       }
       break;
index eacd189840f1daf8e4baade0228f2278d5364c13..18a1a008582640a3fa2d3f1a589893b21680b607 100644 (file)
@@ -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();"));