diff options
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index 0edb19166d..4caffd911b 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -2000,7 +2000,18 @@ TEST_F(FormatTest, UnderstandsTemplateParameters) { TEST_F(FormatTest, UnderstandsBinaryOperators) { verifyFormat("COMPARE(a, ==, b);"); - verifyFormat("(a->*f)()"); +} + +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;"); } TEST_F(FormatTest, UnderstandsUnaryOperators) { |