From b09075a24068694c8d982c6df97646c91d133876 Mon Sep 17 00:00:00 2001 From: Anders Waldenborg Date: Tue, 19 May 2015 16:54:26 +0000 Subject: clang-format: Add space in function pointers with SpaceBeforeParens=Always "void (*my_function)(void)" should become "void (*my_function) (void)" when SpaceBeforeParens is set to 'Always' Differential Revision: http://reviews.llvm.org/D9835 llvm-svn: 237704 --- clang/unittests/Format/FormatTest.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/unittests/Format/FormatTest.cpp') diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index ead063fe41d..4684d1d746b 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -8454,6 +8454,7 @@ TEST_F(FormatTest, ConfigurableSpaceBeforeParens) { verifyFormat("size_t x = alignof(MyType);", NoSpace); verifyFormat("static_assert(sizeof(char) == 1, \"Impossible!\");", NoSpace); verifyFormat("int f() throw(Deprecated);", NoSpace); + verifyFormat("typedef void (*cb)(int);", NoSpace); FormatStyle Space = getLLVMStyle(); Space.SpaceBeforeParens = FormatStyle::SBPO_Always; @@ -8498,6 +8499,7 @@ TEST_F(FormatTest, ConfigurableSpaceBeforeParens) { verifyFormat("size_t x = alignof (MyType);", Space); verifyFormat("static_assert (sizeof (char) == 1, \"Impossible!\");", Space); verifyFormat("int f () throw (Deprecated);", Space); + verifyFormat("typedef void (*cb) (int);", Space); } TEST_F(FormatTest, ConfigurableSpacesInParentheses) { -- cgit v1.2.3