Minimal example:
#include <type_traits> template<typename derived_type, typename base_type> using inherits_from = typename std::enable_if< std::is_base_of<base_type, derived_type>::value, int>::type; template <class T> struct Foo {}; struct Bar : Foo<Bar> {}; template <typename T, inherits_from<T,Foo<T>> = 0> void baz(T t){} int main() { baz(Bar{}); }
generates:
../source.cpp:15:1: error: syntax error [syntaxError] template <typename T,inherits_from<T,Foo<T>> = 0> ^
but the code compiles just fine, the thing that seems to hickup here is the Foo<T> inside the inherits_from it also seems that only versions above 1.82 are affected when not using Foo<T> or when the code is changed to
Foo<T>
inherits_from
template <typename T, typename = inherits_from<T,Foo<T>>>
the error does not occur
This does not reproduce with v2.3.
Log in to post a comment.
Minimal example:
generates:
but the code compiles just fine, the thing that seems to hickup here is the
Foo<T>
inside theinherits_from
it also seems that only versions above 1.82 are affected
when not using
Foo<T>
or when the code is changed tothe error does not occur
This does not reproduce with v2.3.