https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105482
Bug ID: 105482
Summary: Regression with `>=` in a template argument
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: pdimov at gmail dot com
Target Milestone: ---
The current GCC trunk in C++11 or C++14 mode gives an error when including
boost/mp11/algorithm.hpp (from Boost 1.79):
opt/compiler-explorer/libs/boost_1_79_0/boost/mp11/algorithm.hpp:445:102:
error: '>=' should be '> =' to terminate a template argument list
445 | struct mp_take_c_impl<N, L<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
T...>, typename std::enable_if<N >= 10>::type>
|
^~
|
> =
/opt/compiler-explorer/libs/boost_1_79_0/boost/mp11/algorithm.hpp:445:107:
error: template argument 3 is invalid
445 | struct mp_take_c_impl<N, L<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
T...>, typename std::enable_if<N >= 10>::type>
|
^
/opt/compiler-explorer/libs/boost_1_79_0/boost/mp11/algorithm.hpp:445:114:
error: expected unqualified-id before '>' token
445 | struct mp_take_c_impl<N, L<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
T...>, typename std::enable_if<N >= 10>::type>
|
^
See e.g. https://godbolt.org/z/nE9754and and
https://github.com/boostorg/mp11/issues/73.
GCC 11 works, as does trunk in C++17 mode or later.