зеркало из https://github.com/microsoft/clang-1.git
Fix incorrect recognition of bin-packing.
Before (in Google style): Constructor() : aaaaa(aaaaaa), aaaaa(aaaaaa), aaaaa(aaaaaa), aaaaa(aaaaaa), aaaaa( aaaaaa) {} After: Constructor() : aaaaa(aaaaaa), aaaaa(aaaaaa), aaaaa(aaaaaa), aaaaa(aaaaaa), aaaaa(aaaaaa) {} git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176242 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
807809c421
Коммит
3a39ac7cee
|
@ -654,7 +654,8 @@ private:
|
|||
AvoidBinPacking = false;
|
||||
} else {
|
||||
NewIndent = 4 + State.Stack.back().LastSpace;
|
||||
AvoidBinPacking = !Style.BinPackParameters;
|
||||
AvoidBinPacking =
|
||||
!Style.BinPackParameters || State.Stack.back().AvoidBinPacking;
|
||||
}
|
||||
State.Stack.push_back(
|
||||
ParenState(NewIndent, State.Stack.back().LastSpace, AvoidBinPacking,
|
||||
|
|
|
@ -1173,6 +1173,13 @@ TEST_F(FormatTest, ConstructorInitializers) {
|
|||
" some_other_var_(var + 1) { // lined up\n"
|
||||
"}",
|
||||
OnePerLine);
|
||||
verifyFormat("Constructor()\n"
|
||||
" : aaaaa(aaaaaa),\n"
|
||||
" aaaaa(aaaaaa),\n"
|
||||
" aaaaa(aaaaaa),\n"
|
||||
" aaaaa(aaaaaa),\n"
|
||||
" aaaaa(aaaaaa) {}",
|
||||
OnePerLine);
|
||||
|
||||
// This test takes VERY long when memoization is broken.
|
||||
OnePerLine.BinPackParameters = false;
|
||||
|
|
Загрузка…
Ссылка в новой задаче