diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp --- a/clang/lib/Format/Format.cpp +++ b/clang/lib/Format/Format.cpp @@ -3390,17 +3390,16 @@ UnsuitableConfigFiles); if (!ChildFormatTextToApply.empty()) { - assert(ChildFormatTextToApply.size() == 1); - LLVM_DEBUG(llvm::dbgs() - << "Applying child configuration on fallback style\n"); - - auto Ec = - parseConfiguration(*ChildFormatTextToApply.front(), &FallbackStyle, - AllowUnknownOptions, dropDiagnosticHandler); - // It was already correctly parsed. - assert(!Ec); - static_cast(Ec); + << "Applying child configurations on fallback style\n"); + + for (const auto &MemBuf : llvm::reverse(ChildFormatTextToApply)) { + auto Ec = parseConfiguration(*MemBuf, &FallbackStyle, AllowUnknownOptions, + dropDiagnosticHandler); + // It was already correctly parsed. + assert(!Ec); + static_cast(Ec); + } } return FallbackStyle;