Improve formatting of conditional expressions.
authorDaniel Jasper <djasper@google.com>
Mon, 28 Jan 2013 12:45:14 +0000 (12:45 +0000)
committerDaniel Jasper <djasper@google.com>
Mon, 28 Jan 2013 12:45:14 +0000 (12:45 +0000)
commitca6623b9e3ab292558837b0543e4ab2ac147eb3b
treed76d044d5f27b8a542e088f295340c7241a93abb
parent6f85ef300d76ff766d639e0a932e8a747e7617e1
Improve formatting of conditional expressions.

Before we did not really systematically format those. Now, we format the
different cases as:

- 1 Line:  a ? b : c;
- 2 Lines: short ? loooooooooong
                 : loooooooooong
- 2 Lines: loooooooooooooooong
               ? short : short
- 3 Lines: loooooooooooooooong
               ? loooooooooooooong
               : loooooooooooooong

Not sure whether "?" and ":" should go on the new line, but it seems to
be the most consistent approach.

llvm-svn: 173683
clang/lib/Format/Format.cpp
clang/unittests/Format/FormatTest.cpp