diff options
author | Michael Park <mpark@apache.org> | 2017-01-16 08:14:25 +0000 |
---|---|---|
committer | Michael Park <mpark@apache.org> | 2017-01-16 08:14:25 +0000 |
commit | f4770ea983d0ff826997085e6e8d86cc48dad7f7 (patch) | |
tree | e3aadfdd1b180f0dff35776ec737177ed1895d5c /libcxx/include | |
parent | fba613e407d5f6e1d468bd511c881c5785bc7da7 (diff) | |
download | bcm5719-llvm-f4770ea983d0ff826997085e6e8d86cc48dad7f7.tar.gz bcm5719-llvm-f4770ea983d0ff826997085e6e8d86cc48dad7f7.zip |
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
Diffstat (limited to 'libcxx/include')
-rw-r--r-- | libcxx/include/variant | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/libcxx/include/variant b/libcxx/include/variant index f623cddc200..4396f1062f5 100644 --- a/libcxx/include/variant +++ b/libcxx/include/variant @@ -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> |