llvm-project/clang/unittests
Ben Hamilton 30b7d09d7a [Format/ObjC] Fix [foo bar]->baz formatting as lambda arrow
Summary:
Currently, `UnwrappedLineParser` thinks an arrow token after
an ObjC method expression is a C++ lambda arrow, so it formats:

```
[foo bar]->baz
```

as:

```
[foo bar] -> baz
```

Because `UnwrappedLineParser` runs before `TokenAnnotator`, it can't
know if the arrow token is after an ObjC method expression or not.

This diff makes `TokenAnnotator` remove the TT_LambdaArrow on
the arrow token if it follows an ObjC method expression.

Test Plan: New test added. Ran test with:
  % ninja FormatTests && ./tools/clang/unittests/Format/FormatTests
  Confirmed test failed before diff and passed after diff.

Reviewers: krasimir, djasper, sammccall

Reviewed By: sammccall

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D57923

llvm-svn: 353531
2019-02-08 15:55:18 +00:00
..
AST [ASTImporter][ASTImporterSpecificLookup] Add test for different operators 2019-02-08 09:19:34 +00:00
ASTMatchers [CUDA] add support for the new kernel launch API in CUDA-9.2+. 2019-01-31 21:34:03 +00:00
Analysis [clang] add tests to ExprMutAnalyzer that reproduced a crash in ASTMatchers 2019-01-21 13:26:18 +00:00
Basic [FileManager] Revert r347205 to avoid PCH file-descriptor leak. 2019-01-24 18:55:24 +00:00
CodeGen Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CrossTU Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Driver Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Format [Format/ObjC] Fix [foo bar]->baz formatting as lambda arrow 2019-02-08 15:55:18 +00:00
Frontend Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Index Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Lex Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Rename Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Rewrite Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Sema [CodeComplete] Propagate preferred types through parser in more cases 2019-01-31 20:20:32 +00:00
StaticAnalyzer Accomodate gcc 7.3.0's -Wdangling-else 2019-01-31 15:26:03 +00:00
Tooling [Tooling] Handle #pragma once header guard in include insertion. 2019-01-29 14:40:01 +00:00
libclang Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CMakeLists.txt [Index] Add an option to collect macros from preprocesor. 2018-09-18 08:51:08 +00:00