From 80f34e2716e8e69347ae16da5fff7114442db310 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 27 Feb 2025 20:18:02 -0800 Subject: [clang-format] Change BracedInitializerIndentWidth to int (#128988) Fixes #108526 --- clang/lib/Format/ContinuationIndenter.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'clang/lib/Format/ContinuationIndenter.cpp') 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; } -- cgit v1.1