[PATCH] D71939: clang-format: fix conflict between FormatStyle::BWACS_MultiLine and BeforeCatch/BeforeElse

Pablo Martin-Gomez via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 27 15:32:13 PST 2019


Bouska requested changes to this revision.
Bouska added a comment.
This revision now requires changes to proceed.

So, you are trying to fix the issue at the wrong place. Contrary from what we should expect from a UnwrappedLine, BWACS_Multiline works by always wrapping the brace in UnwrappedLineParser, and afterwards in UnwrappedLineFormatter merging it back to the control statement if it's not in multi-line. The bug is on the control statement @ line 308 on UnwrappedLineFormatter.cpp <https://github.com/llvm-mirror/clang/blob/master/lib/Format/UnwrappedLineFormatter.cpp#L308>. That's the block that merge the brace back to its control statement if it is not a multiline and it's executed only with a line with a else or a catch that begins with right curly brace.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71939/new/

https://reviews.llvm.org/D71939





More information about the cfe-commits mailing list