Index: clang/lib/Format/Format.cpp =================================================================== --- clang/lib/Format/Format.cpp +++ clang/lib/Format/Format.cpp @@ -2844,8 +2844,15 @@ FormatStyle Style = getLLVMStyle(guessLanguage(FileName, Code)); FormatStyle FallbackStyle = getNoStyle(); - if (!getPredefinedStyle(FallbackStyleName, Style.Language, &FallbackStyle)) - return make_string_error("Invalid fallback style \"" + FallbackStyleName); + if (FallbackStyleName.startswith("{")) { + if (std::error_code ec = parseConfiguration( + FallbackStyleName, &FallbackStyle, AllowUnknownOptions)) + return make_string_error("Error parsing -fallback-style: " + + ec.message()); + } else if (!getPredefinedStyle(FallbackStyleName, Style.Language, + &FallbackStyle)) { + return make_string_error("Invalid fallback style \"" + FallbackStyleName + "\""); + } if (StyleName.startswith("{")) { // Parse YAML/JSON style from the command line.