Index: lib/APINotes/APINotesYAMLCompiler.cpp =================================================================== --- lib/APINotes/APINotesYAMLCompiler.cpp +++ lib/APINotes/APINotesYAMLCompiler.cpp @@ -164,7 +164,15 @@ AvailabilityItem() : Mode(APIAvailability::Available), Msg("") {} }; - static llvm::Optional AbsentNullability = llvm::None; + // There is a bug in MSVC that causes an internal compiler error in compilation. + // See: https://connect.microsoft.com/VisualStudio/feedback/details/3111599/ + // This is a workaround that issue until the problem gets fixed. +#if defined(_MSC_VER) + static llvm::Optional AbsentNullability = llvm::NoneType::None; +#else + static llvm::Optional AbsentNullability = None; +#endif + static llvm::Optional DefaultNullability = NullabilityKind::NonNull; typedef std::vector NullabilitySeq;