[Bug c++/110856] New: GCC rejects template alias of function type as invalid template parameter
hewillk at gmail dot com
gcc-bugzilla@gcc.gnu.org
Mon Jul 31 08:44:16 GMT 2023
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110856
Bug ID: 110856
Summary: GCC rejects template alias of function type as invalid
template parameter
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: hewillk at gmail dot com
Target Milestone: ---
GCC rejects the following valid case:
#include <utility>
#include <type_traits>
#include <functional>
template<std::size_t, class T>
using identity = T;
template<class R, class Arg, std::size_t N>
using MakeFunType = decltype(
[]<std::size_t... Is>(std::index_sequence<Is...>) {
return std::type_identity<R(identity<Is, Arg>...)>{};
}(std::make_index_sequence<N>{})
)::type;
template<std::size_t N>
class S {
using F1 = std::function<MakeFunType<void, int, 3>>; // ok
using F2 = std::function<MakeFunType<void, int, N>>; // syntax error
};
https://godbolt.org/z/fc638b4Y1
More information about the Gcc-bugs
mailing list