]> granicus.if.org Git - clang/commit
clang-format: Format extern "C" blocks like namespace blocks.
authorNico Weber <nicolasweber@gmx.de>
Thu, 13 Nov 2014 16:25:37 +0000 (16:25 +0000)
committerNico Weber <nicolasweber@gmx.de>
Thu, 13 Nov 2014 16:25:37 +0000 (16:25 +0000)
commit8be48bc867e110050254253eb86fc53494620321
tree7cff1835348f02b5ebdbab89d9c7c0deea071ab6
parentffc8655a156b1f621379495c581004c33ee212b4
clang-format: Format extern "C" blocks like namespace blocks.

namespace blocks act as if KeepEmptyLinesAtTheStartOfBlocks is always true,
and aren't collapsed to a single line even if they would fit. Do the same
for extern "C" blocks.

Before,

  extern "C" {

  void ExternCFunction();

  }

was collapsed into `extern "C" { void ExternCFunction(); }`. Now it stays like
it was.

Fixes http://crbug.com/432640 and part of PR21419.

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