]> granicus.if.org Git - clang/commit
[clang-format] Add new style option IndentGotoLabels
authorPaul Hoad <mydeveloperday@gmail.com>
Thu, 12 Sep 2019 10:07:14 +0000 (10:07 +0000)
committerPaul Hoad <mydeveloperday@gmail.com>
Thu, 12 Sep 2019 10:07:14 +0000 (10:07 +0000)
commit3bd37f41b924983c3a52f02046538605808b90c0
tree8234a499c2ee3d1087f855ea9067f2cdd7cd2951
parente2909eb05f8bbcbd538c79f376e4acfa53c8082f
[clang-format] Add new style option IndentGotoLabels

Summary:
This option determines whether goto labels are indented according to scope. Setting this option to false causes goto labels to be flushed to the left.
This is mostly copied from [[ http://lists.llvm.org/pipermail/cfe-dev/2015-September/045014.html | this patch ]] submitted by Christian Neukirchen that didn't make its way into trunk.

```
     true:                                  false:
     int f() {                      vs.     int f() {
       if (foo()) {                           if (foo()) {
       label1:                              label1:
         bar();                                 bar();
       }                                      }
     label2:                                label2:
       return 1;                              return 1;
     }                                      }
```

Reviewers: klimek, MyDeveloperDay

Reviewed By: MyDeveloperDay

Subscribers: cfe-commits

Tags: #clang, #clang-tools-extra

Patch by: tetsuo-cpp

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371719 91177308-0d34-0410-b5e6-96231b3b80d8
docs/ClangFormatStyleOptions.rst
include/clang/Format/Format.h
lib/Format/Format.cpp
lib/Format/UnwrappedLineParser.cpp
lib/Format/UnwrappedLineParser.h
unittests/Format/FormatTest.cpp