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 | a1dc93a5bd96017b060d1b138443135ff8231a44 (patch) | |
tree | d71c30e7dfa70eb41960d3fca709afef28f57b15 /clang/unittests/Format/FormatTest.cpp | |
parent | ced17f8cd562ffd086ef90de02a60cfe769120b7 (diff) | |
download | bcm5719-llvm-a1dc93a5bd96017b060d1b138443135ff8231a44.tar.gz bcm5719-llvm-a1dc93a5bd96017b060d1b138443135ff8231a44.zip |
Improve understanding of unary operators.
Before: int x = ** a;
After: int x = **a;
llvm-svn: 172619
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 7d8ed14191f..6dd7cad1380 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/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);"); |