From f9b2e92040f52739585a9036a72c2b8fa3576013 Mon Sep 17 00:00:00 2001 From: Antonio Sanchez Date: Fri, 29 Oct 2021 09:28:11 -0700 Subject: [PATCH] Remove bad "take" impl that causes g++-11 crash. For some reason, having `take>` for `n > 0` causes g++-11 to ICE with ``` sorry, unimplemented: unexpected AST of kind nontype_argument_pack ``` It does work with other versions of gcc, and with clang. I filed a GCC bug [here](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102999). Technically we should never actually run into this case, since you can't take n > 0 elements from an empty list. Commenting it out allows our Eigen tests to pass. (cherry picked from commit 8f8c2ba2fe19c6c2e47bbe2fbaf87594642e523d) --- unsupported/Eigen/CXX11/src/util/CXX11Meta.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/unsupported/Eigen/CXX11/src/util/CXX11Meta.h b/unsupported/Eigen/CXX11/src/util/CXX11Meta.h index 149ceaff0..f662dee5b 100644 --- a/unsupported/Eigen/CXX11/src/util/CXX11Meta.h +++ b/unsupported/Eigen/CXX11/src/util/CXX11Meta.h @@ -81,7 +81,8 @@ template struct take<0, type_list> template<> struct take<0, type_list<>> { typedef type_list<> type; }; template struct take> : concat, typename take>::type> {}; -template struct take> { typedef numeric_list type; }; +// XXX The following breaks in gcc-11, and is invalid anyways. +// template struct take> { typedef numeric_list type; }; template struct take<0, numeric_list> { typedef numeric_list type; }; template struct take<0, numeric_list> { typedef numeric_list type; };