]> granicus.if.org Git - clang/commit
[clang-format] Add SpaceBeforeColon option
authorFrancois Ferrand <thetypz@gmail.com>
Thu, 1 Mar 2018 10:09:13 +0000 (10:09 +0000)
committerFrancois Ferrand <thetypz@gmail.com>
Thu, 1 Mar 2018 10:09:13 +0000 (10:09 +0000)
commit2818cfe4cbfcbceed9ed0aca79c91a958636691e
treec00e8cb9067b3d10d6725b842c5756940fdfeb98
parente845f691846783e8e30d3131c8f8a08311c406e8
[clang-format] Add SpaceBeforeColon option

Summary:
When disabled, this option allows removing the space before colon,
making it act more like the semi-colon. When enabled (default), the
current behavior is not affected.

This mostly affects C++11 loop, initializer list, inheritance list and
container literals:

  class Foo: Bar {}
  Foo::Foo(): a(a) {}
  for (auto i: myList) {}
  f({a: 1, b: 2, c: 3});

Reviewers: krasimir, djasper

Reviewed By: djasper

Subscribers: xvallspl, teemperor, karies, cfe-commits, klimek

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

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