diff --git a/include/llvm/Support/TrailingObjects.h b/include/llvm/Support/TrailingObjects.h index 4d355724149..051c65ad0d9 100644 --- a/include/llvm/Support/TrailingObjects.h +++ b/include/llvm/Support/TrailingObjects.h @@ -231,7 +231,14 @@ class TrailingObjectsImpl /// See the file comment for details on the usage of the /// TrailingObjects type. template + +// Work around MSVC build error: cannot access inaccessible struct declared +// in class'llvm::trailing_objects_internal::TrailingObjectsBase' +#if defined(_MSC_VER) +class TrailingObjects : protected trailing_objects_internal::TrailingObjectsImpl< +#else class TrailingObjects : private trailing_objects_internal::TrailingObjectsImpl< +#endif trailing_objects_internal::AlignmentCalcHelper< TrailingTys...>::Alignment, BaseTy, TrailingObjects,