diff options
author | Daniel Jasper <djasper@google.com> | 2013-01-14 12:18:19 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-01-14 12:18:19 +0000 |
commit | 4abbb535f0f050aea6373e26e769643c3c61a9b1 (patch) | |
tree | 04f8486aa5de248a67d1149716d9cfd65a0da4ce /unittests/Format/FormatTest.cpp | |
parent | a4ae9f30ef7bccdaa3feef8036af07fbb91f107c (diff) |
Improve understanding post increment and decrement.
Before: (a->f()) ++;
a[42] ++;
After: (a->f())++;
a[42]++;
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172400 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index eb87a3b965..9565e3a855 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -978,6 +978,8 @@ TEST_F(FormatTest, UnderstandsUnaryOperators) { verifyFormat("if (i < -1) {}"); verifyFormat("++(a->f());"); verifyFormat("--(a->f());"); + verifyFormat("(a->f())++;"); + verifyFormat("a[42]++;"); verifyFormat("if (!(a->f())) {}"); verifyFormat("a-- > b;"); |