owenpan added inline comments.
================ Comment at: clang/lib/Format/Format.cpp:666-677 + if (Style.PackConstructorInitializers == FormatStyle::PCIS_BinPack) { + bool OnCurrentLine = false; + IO.mapOptional("ConstructorInitializerAllOnOneLineOrOnePerLine", + OnCurrentLine); + if (OnCurrentLine) { + bool OnNextLine = false; + IO.mapOptional("AllowAllConstructorInitializersOnNextLine", OnNextLine); ---------------- Also need to handle the default value `PCIS_NextLine` for Google and Chromium styles: ``` StringRef BasedOn; IO.mapOptional("BasedOnStyle", BasedOn); const bool IsGoogleOrChromium = BasedOn.equals_insensitive("google") || BasedOn.equals_insensitive("chromium"); bool OnCurrentLine = IsGoogleOrChromium; bool OnNextLine = IsGoogleOrChromium; IO.mapOptional("ConstructorInitializerAllOnOneLineOrOnePerLine", OnCurrentLine); IO.mapOptional("AllowAllConstructorInitializersOnNextLine", OnNextLine); if (IsGoogleOrChromium && Style.PackConstructorInitializers == FormatStyle::PCIS_NextLine) { if (!OnCurrentLine) Style.PackConstructorInitializers = FormatStyle::PCIS_BinPack; else if (!OnNextLine) Style.PackConstructorInitializers = FormatStyle::PCIS_CurrentLine; } else if (Style.PackConstructorInitializers == FormatStyle::PCIS_BinPack && OnCurrentLine) { Style.PackConstructorInitializers = OnNextLine ? FormatStyle::PCIS_NextLine : FormatStyle::PCIS_CurrentLine; } ``` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D108752/new/ https://reviews.llvm.org/D108752 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits