MaskRay added a comment. `getFormattingLangOpts` is called with unadjusted FormatStyle (`deriveLocalStyle` doesn't modify `Style`). For example, GoogleStyle uses `FormatStyle::LS_Auto`. We're relying on `FormatStyle::LS_Auto` being larger than `FormatStyle::LS_Cpp11`, which is brittle.
Below is a case `getFormattingLangOpts` is called with `LS_Auto`: TEST_F(CleanUpReplacementsTest, InsertMultipleIncludesGoogleStyle) { ... Style = format::getGoogleStyle(format::FormatStyle::LanguageKind::LK_Cpp); EXPECT_EQ(Expected, apply(Code, Replaces)); Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65194/new/ https://reviews.llvm.org/D65194 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits