Итак, почему это происходит:
Код: Выделить всё
enum kind_t { kind1, kind2 };
template struct foo {};
template struct foo {
enum named : int;
};
enum foo::named : int {
named1 = 123,
named2 = 456,
};
Код: Выделить всё
:9:6: error: cannot add an enumerator list to a template instantiation
9 | enum foo::named : int {
| ^~~~~~~~~~
ASM generation compiler returned: 1
:9:6: error: cannot add an enumerator list to a template instantiation
9 | enum foo::named : int {
| ^~~~~~~~~~
Подробнее здесь: https://stackoverflow.com/questions/734 ... s-with-gcc