Better fix for r177725.
It turns out that
-foo;
can be an objective C method declaration. So instead of the previous
solution, recognize objective C methods only if we are in a declaration
scope.
llvm-svn: 177740
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 0840302..5988a90 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -2815,6 +2815,7 @@
// If there's no return type (very rare in practice!), LLVM and Google style
// agree.
+ verifyFormat("- foo;");
verifyFormat("- foo:(int)f;");
verifyGoogleFormat("- foo:(int)foo;");
}