diff options
author | Nico Weber <nicolasweber@gmx.de> | 2013-02-06 06:20:11 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2013-02-06 06:20:11 +0000 |
commit | 5d2624e53a6036d4ef29f7150637957c16cd519b (patch) | |
tree | 76c53d91f688fd8bd027453ca35cd651c46572d9 /clang/unittests | |
parent | 231e7aa460a90d350f677aba71d123e14c5fa05f (diff) | |
download | bcm5719-llvm-5d2624e53a6036d4ef29f7150637957c16cd519b.tar.gz bcm5719-llvm-5d2624e53a6036d4ef29f7150637957c16cd519b.zip |
Formatter: No space after & and * in front of ObjC message expressions.
1. let determineStarAmp() check of unary operators before checking for
"is next '['". That check was added in r173150, and the test from that
revision passes either way.
2. change determineStarAmp() to categorize '*' and '&' after '=' as unary
operator.
3. don't let parseSquare() overwrite the type of a '*' or '&' before the start
of an objc message expression if has the role of unary operator.
llvm-svn: 174489
Diffstat (limited to 'clang/unittests')
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index fc52e834aab..fbe5f30f70b 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -2245,9 +2245,8 @@ TEST_F(FormatTest, FormatObjCMethodExpr) { verifyFormat("int a = --[foo bar:baz];"); verifyFormat("int a = sizeof [foo bar:baz];"); verifyFormat("int a = alignof [foo bar:baz];"); - // FIXME: no space after & and *. - verifyFormat("int a = & [foo bar:baz];"); - verifyFormat("int a = * [foo bar:baz];"); + verifyFormat("int a = &[foo bar:baz];"); + verifyFormat("int a = *[foo bar:baz];"); // FIXME: Make casts work, without breaking f()[4]. //verifyFormat("int a = (int) [foo bar:baz];"); |