diff options
author | Owen Pan <owenpiano@gmail.com> | 2025-02-27 20:18:02 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-27 20:18:02 -0800 |
commit | 80f34e2716e8e69347ae16da5fff7114442db310 (patch) | |
tree | 93b3987ba316e282ff5c43210f64a8a87c78805b /clang/lib/Format/ContinuationIndenter.cpp | |
parent | bafd44bff58cff9efe569a221b232bab004d55cd (diff) | |
download | llvm-80f34e2716e8e69347ae16da5fff7114442db310.zip llvm-80f34e2716e8e69347ae16da5fff7114442db310.tar.gz llvm-80f34e2716e8e69347ae16da5fff7114442db310.tar.bz2 |
[clang-format] Change BracedInitializerIndentWidth to int (#128988)
Fixes #108526
Diffstat (limited to 'clang/lib/Format/ContinuationIndenter.cpp')
-rw-r--r-- | clang/lib/Format/ContinuationIndenter.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp index d49128c..972dceb 100644 --- a/clang/lib/Format/ContinuationIndenter.cpp +++ b/clang/lib/Format/ContinuationIndenter.cpp @@ -1921,9 +1921,9 @@ void ContinuationIndenter::moveStatePastScopeOpener(LineState &State, NewIndent = Style.IndentWidth + std::min(State.Column, CurrentState.NestedBlockIndent); } else if (Current.is(tok::l_brace)) { - NewIndent = - CurrentState.LastSpace + Style.BracedInitializerIndentWidth.value_or( - Style.ContinuationIndentWidth); + const auto Width = Style.BracedInitializerIndentWidth; + NewIndent = CurrentState.LastSpace + + (Width < 0 ? Style.ContinuationIndentWidth : Width); } else { NewIndent = CurrentState.LastSpace + Style.ContinuationIndentWidth; } |