Index: clang/lib/Format/Format.cpp =================================================================== --- clang/lib/Format/Format.cpp +++ clang/lib/Format/Format.cpp @@ -3483,26 +3483,23 @@ } if (Style.InsertBraces) { - FormatStyle S = Expanded; - S.InsertBraces = true; - Passes.emplace_back([&, S](const Environment &Env) { - return BracesInserter(Env, S).process(/*SkipAnnotation=*/true); + Expanded.InsertBraces = true; + Passes.emplace_back([&](const Environment &Env) { + return BracesInserter(Env, Expanded).process(/*SkipAnnotation=*/true); }); } if (Style.RemoveBracesLLVM) { - FormatStyle S = Expanded; - S.RemoveBracesLLVM = true; - Passes.emplace_back([&, S](const Environment &Env) { - return BracesRemover(Env, S).process(/*SkipAnnotation=*/true); + Expanded.RemoveBracesLLVM = true; + Passes.emplace_back([&](const Environment &Env) { + return BracesRemover(Env, Expanded).process(/*SkipAnnotation=*/true); }); } if (Style.RemoveSemicolon) { - FormatStyle S = Expanded; - S.RemoveSemicolon = true; - Passes.emplace_back([&, S](const Environment &Env) { - return SemiRemover(Env, S).process(/*SkipAnnotation=*/true); + Expanded.RemoveSemicolon = true; + Passes.emplace_back([&](const Environment &Env) { + return SemiRemover(Env, Expanded).process(/*SkipAnnotation=*/true); }); } Index: clang/utils/TableGen/ClangAttrEmitter.cpp =================================================================== --- clang/utils/TableGen/ClangAttrEmitter.cpp +++ clang/utils/TableGen/ClangAttrEmitter.cpp @@ -3954,7 +3954,7 @@ for (const Record *Exclusion : ExclusionsList) { std::vector MutuallyExclusiveAttrs = Exclusion->getValueAsListOfDefs("Exclusions"); - auto IsCurAttr = [Attr](const Record *R) { + auto IsCurAttr = [&Attr](const Record *R) { return R->getName() == Attr.getName(); }; if (llvm::any_of(MutuallyExclusiveAttrs, IsCurAttr)) {