mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-21 07:19:46 +08:00
Remove bad "take" impl that causes g++-11 crash.
For some reason, having `take<n, numeric_list<T>>` 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.
This commit is contained in:
parent
f6c8cc0e99
commit
8f8c2ba2fe
@ -81,7 +81,8 @@ template<typename a, typename... as> struct take<0, type_list<a, as...>>
|
|||||||
template<> struct take<0, type_list<>> { typedef type_list<> type; };
|
template<> struct take<0, type_list<>> { typedef type_list<> type; };
|
||||||
|
|
||||||
template<typename T, int n, T a, T... as> struct take<n, numeric_list<T, a, as...>> : concat<numeric_list<T, a>, typename take<n-1, numeric_list<T, as...>>::type> {};
|
template<typename T, int n, T a, T... as> struct take<n, numeric_list<T, a, as...>> : concat<numeric_list<T, a>, typename take<n-1, numeric_list<T, as...>>::type> {};
|
||||||
template<typename T, int n> struct take<n, numeric_list<T>> { typedef numeric_list<T> type; };
|
// XXX The following breaks in gcc-11, and is invalid anyways.
|
||||||
|
// template<typename T, int n> struct take<n, numeric_list<T>> { typedef numeric_list<T> type; };
|
||||||
template<typename T, T a, T... as> struct take<0, numeric_list<T, a, as...>> { typedef numeric_list<T> type; };
|
template<typename T, T a, T... as> struct take<0, numeric_list<T, a, as...>> { typedef numeric_list<T> type; };
|
||||||
template<typename T> struct take<0, numeric_list<T>> { typedef numeric_list<T> type; };
|
template<typename T> struct take<0, numeric_list<T>> { typedef numeric_list<T> type; };
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user