[PATCH] D28222: [libcxx] Re-implement LWG 2770 again: Fix tuple_size to work with structured bindings

Eric Fiselier via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 3 00:45:53 PST 2017


EricWF added inline comments.


================
Comment at: include/__tuple:32
 template <class _Tp>
-class _LIBCPP_TYPE_VIS_ONLY tuple_size<const _Tp>
-    : public __tuple_size_base_type<_Tp>::type {};
+class _LIBCPP_TYPE_VIS_ONLY tuple_size<__enable_if_tuple_size_imp<const _Tp, decltype(tuple_size<typename remove_cv<_Tp>::type>::value)>>
+    : public integral_constant<size_t, tuple_size<_Tp>::value> {};
----------------
rsmith wrote:
> remove_cv looks redundant here, deduction already stripped the cv qualifiers.
The `remove_cv` should be redundant, but without it Clang segfaults in `clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformTemplateSpecializationType(clang::TypeLocBuilder&, clang::TemplateSpecializationTypeLoc, clang::TemplateName)`. 

I haven't had time to file a Clang bug yet.


https://reviews.llvm.org/D28222





More information about the cfe-commits mailing list