diff options
author | Daniel Jasper <djasper@google.com> | 2013-01-16 16:04:06 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-01-16 16:04:06 +0000 |
commit | 48bd7b72b8911147ec9bdeaa8ebb211543fd23a9 (patch) | |
tree | 4324b2931e43cc11ccfbe76afc804cb210e2732d /unittests/Format/FormatTest.cpp | |
parent | df3736aa70443ac0f33af094989b4ba88d73f568 (diff) |
Improve understanding of unary operators.
Before: int x = ** a;
After: int x = **a;
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172619 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index 7d8ed14191..6dd7cad138 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -1167,6 +1167,11 @@ TEST_F(FormatTest, UnderstandsUsesOfStarAndAmp) { verifyGoogleFormat("A<int**, int**> a;"); verifyGoogleFormat("f(b ? *c : *d);"); verifyGoogleFormat("int a = b ? *c : *d;"); + verifyGoogleFormat("Type* t = **x;"); + verifyGoogleFormat("Type* t = *++*x;"); + verifyGoogleFormat("*++*x;"); + verifyGoogleFormat("Type* t = const_cast<T*>(&*x);"); + verifyGoogleFormat("Type* t = x++ * y;"); verifyFormat("a = *(x + y);"); verifyFormat("a = &(x + y);"); |