]> granicus.if.org Git - clang/commit
Adds support for formatting NS_CLOSED_ENUM and CF_CLOSED_ENUM alongside NS_ENUM and...
authorBen Hamilton <benhamilton@google.com>
Mon, 22 Jul 2019 18:20:01 +0000 (18:20 +0000)
committerBen Hamilton <benhamilton@google.com>
Mon, 22 Jul 2019 18:20:01 +0000 (18:20 +0000)
commit83a361438a1bc830995e8816110904247eb0e20d
tree214686bd6db4709455f72580eaa1b89d848949f9
parentdffd3559afa4be1df1991d27d897a079e1724c36
Adds support for formatting NS_CLOSED_ENUM and CF_CLOSED_ENUM alongside NS_ENUM and CF_ENUM.

Summary:
Addresses the formatting of NS_CLOSED_ENUM and CF_CLOSED_ENUM, introduced in Swift 5.

Before:

```
typedef NS_CLOSED_ENUM(NSInteger, Foo){FooValueOne = 1, FooValueTwo,
                                       FooValueThree};
```

After:

```
typedef NS_CLOSED_ENUM(NSInteger, Foo) {
  FooValueOne = 1,
  FooValueTwo,
  FooValueThree
};
```

Contributed by heijink.

Reviewers: benhamilton, krasimir

Reviewed By: benhamilton

Subscribers: cfe-commits

Tags: #clang

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366719 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Format/Format.cpp
lib/Format/FormatToken.h
lib/Format/UnwrappedLineParser.cpp
unittests/Format/FormatTest.cpp
unittests/Format/FormatTestObjC.cpp