Fix formatting of pointers to members.
Before: int(S::*func)(void *);
After: int (S::*func)(void *);
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181438 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index 3a97abe..715c55f 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -2417,14 +2417,15 @@
TEST_F(FormatTest, UnderstandsPointersToMembers) {
verifyFormat("int A::*x;");
- // FIXME: Recognize pointers to member functions.
- //verifyFormat("int (S::*func)(void *);");
- verifyFormat("int(S::*func)(void *);");
- verifyFormat("(a->*f)();");
- verifyFormat("a->*x;");
- verifyFormat("(a.*f)();");
- verifyFormat("((*a).*f)();");
- verifyFormat("a.*x;");
+ verifyFormat("int (S::*func)(void *);");
+ verifyFormat("typedef bool (Class::*Member)() const;");
+ verifyFormat("void f() {\n"
+ " (a->*f)();\n"
+ " a->*x;\n"
+ " (a.*f)();\n"
+ " ((*a).*f)();\n"
+ " a.*x;\n"
+ "}");
}
TEST_F(FormatTest, UnderstandsUnaryOperators) {