From 732e67b3066e8dcb9da02cffe8ab5fd193f21436 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Wed, 8 Mar 2017 01:57:40 +0000 Subject: [PATCH] Work around an ICE on MSVC 2017. MSVC 2017 was released today, and I found one bug in the compiler which prevents a successful build of LLVM. This patch works around the bug in a fairly benign way. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297255 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/STLExtras.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/include/llvm/ADT/STLExtras.h b/include/llvm/ADT/STLExtras.h index d4cbc587e55..0389e3da4b1 100644 --- a/include/llvm/ADT/STLExtras.h +++ b/include/llvm/ADT/STLExtras.h @@ -358,21 +358,27 @@ template struct index_sequence_for; namespace detail { using std::declval; +// We have to alias this since inlining the actual type at the usage site +// in the parameter list of iterator_facade_base<> below ICEs MSVC 2017. +template struct ZipTupleType { + typedef std::tuple())...> type; +}; + template using zip_traits = iterator_facade_base< ZipType, typename std::common_type::iterator_category...>::type, // ^ TODO: Implement random access methods. - std::tuple())...>, + typename ZipTupleType::type, typename std::iterator_traits>::type>::difference_type, // ^ FIXME: This follows boost::make_zip_iterator's assumption that all // inner iterators have the same difference_type. It would fail if, for // instance, the second field's difference_type were non-numeric while the // first is. - std::tuple())...> *, - std::tuple())...>>; + typename ZipTupleType::type *, + typename ZipTupleType::type>; template struct zip_common : public zip_traits {