The code is at https://godbolt.org/z/KvjecnTe3. The code can be compiled if switching to clang 13.0.1, but gcc 11.2 or the trunk version fails. Interestingly, if I comment out line 22 and 23 as
// boost::mp11::mp_list<enum_<Foo::A1>, int>,
// boost::mp11::mp_list<enum_<Foo::A2>, double>,
then gcc can successfully compile the code. Any ideas?