diff options
author | Daniel Jasper <djasper@google.com> | 2013-03-22 10:44:43 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-03-22 10:44:43 +0000 |
commit | b5985420d5910e068b0c8b84b8af2223e6bdf130 (patch) | |
tree | 57ff03478251942986bd43444d1d5f1b54ac71a8 /unittests | |
parent | b2cc52159023b2008cf028dc6bf153c264fc686f (diff) |
More precisely recognize ObjC method declarations.
Otherwise, +/- and the beginning of constants can be recognized
incorrectly.
Before: #define A - 1
After: #define A -1
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177725 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-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 dc77c77e45..051deebc09 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -2067,6 +2067,8 @@ TEST_F(FormatTest, UnderstandsUnaryOperators) { "case -1:\n" " break;\n" "}"); + verifyFormat("#define X -1"); + verifyFormat("#define X -kConstant"); verifyFormat("const NSPoint kBrowserFrameViewPatternOffset = { -5, +3 };"); verifyFormat("const NSPoint kBrowserFrameViewPatternOffset = { +5, -3 };"); |