aboutsummaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorAlexander Kornienko <alexfh@google.com>2013-03-20 16:41:56 +0000
committerAlexander Kornienko <alexfh@google.com>2013-03-20 16:41:56 +0000
commit54a38bd5cf243310290f34b43fc940a498a00f90 (patch)
treea2950daa9d25641a7a79675898464262b983a908 /unittests
parent92f9faf3cf1065f987f227e0c2fdf06fcccf1ae8 (diff)
Support for pointers-to-members usage via .*
Summary: Added support for pointers-to-members usage via .* and a few tests. Reviewers: djasper Reviewed By: djasper CC: cfe-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D556 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177537 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/Format/FormatTest.cpp13
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) {