[PATCH] clang-format: Support @synchronized.

Nico Weber thakis at chromium.org
Fri Jun 26 07:47:08 PDT 2015


================
Comment at: unittests/Format/FormatTest.cpp:7330
@@ -7329,3 +7353,3 @@
   verifyFormat("SEL s = @selector(foo:);");
-  verifyFormat("@synchronized(self) {\n"
                "  f();\n"
----------------
Hm, this looks like a bit of a regression. I've never seen @synchronized() with a space before the `(` – https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Multithreading/ThreadSafety/ThreadSafety.html puts spaces after the if but not after @synchronized for example.

Maybe spaceRequiredBetween() could always return false if Right is '(' and the token before Left is @?

I'm not sure this even needs an option.

http://reviews.llvm.org/D10371

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list