// Find the best ColumnFormat, i.e. the best number of columns to use.
const ColumnFormat *Format = getColumnFormat(RemainingCodePoints);
+ // If no ColumnFormat can be used, the braced list would generally be
+ // bin-packed. Add a severe penalty to this so that column layouts are
+ // prefered if possible.
if (!Format)
- return 0;
+ return 10000;
// Format the entire list.
unsigned Penalty = 0;
verifyFormat(
"std::this_thread::sleep_for(\n"
" std::chrono::nanoseconds{ std::chrono::seconds{ 1 } } / 5);");
+ verifyFormat("std::vector<MyValues> aaaaaaaaaaaaaaaaaaa{\n"
+ " aaaaaaa, aaaaaaaaaa,\n"
+ " aaaaa, aaaaaaaaaaaaaaa,\n"
+ " aaa, aaaaaaaaaa,\n"
+ " a, aaaaaaaaaaaaaaaaaaaaa,\n"
+ " aaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaa,\n"
+ " aaaaaaa, a\n"
+ "};");
FormatStyle NoSpaces = getLLVMStyle();
NoSpaces.Cpp11BracedListStyle = true;