Added a workaround for a -fdelayed-template-parsing bug.

Summary:
There seems to be an additional bug in `-fdelayed-template-parsing`
similar to
http://llvm.org/viewvc/llvm-project?view=revision&revision=236063.

This is a workaround for it for <variant> to compile with `clang-cl` on Windows.

Reviewers: EricWF

Differential Revision: https://reviews.llvm.org/D28734

llvm-svn: 292097
This commit is contained in:
Michael Park 2017-01-16 08:14:25 +00:00
parent fba613e407
commit f4770ea983
2 changed files with 13 additions and 11 deletions

View File

@ -466,17 +466,22 @@ private:
return __result{{_VSTD::forward<_Fs>(__fs)...}};
}
template <class _Fp, class... _Vs, size_t... _Is>
inline _LIBCPP_INLINE_VISIBILITY
static constexpr auto __make_dispatch(index_sequence<_Is...>) {
struct __dispatcher {
static constexpr decltype(auto) __dispatch(_Fp __f, _Vs... __vs) {
template <std::size_t... _Is>
struct __dispatcher {
template <class _Fp, class... _Vs>
inline _LIBCPP_INLINE_VISIBILITY
static constexpr decltype(auto) __dispatch(_Fp __f, _Vs... __vs) {
return __invoke_constexpr(
static_cast<_Fp>(__f),
__access::__base::__get_alt<_Is>(static_cast<_Vs>(__vs))...);
}
};
return _VSTD::addressof(__dispatcher::__dispatch);
}
};
template <class _Fp, class... _Vs, size_t... _Is>
inline _LIBCPP_INLINE_VISIBILITY
static constexpr auto __make_dispatch(index_sequence<_Is...>) {
return _VSTD::addressof(
__dispatcher<_Is...>::template __dispatch<_Fp, _Vs...>);
}
template <size_t _Ip, class _Fp, class... _Vs>

View File

@ -10,9 +10,6 @@
// UNSUPPORTED: c++98, c++03, c++11, c++14
// FIXME: This test hangs for an unknown reason on Windows. See llvm.org/PR31642
// UNSUPPORTED: windows
// <variant>
// template <class Visitor, class... Variants>
// constexpr see below visit(Visitor&& vis, Variants&&... vars);