https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123961
--- Comment #4 from Rich Townsend <townsend at astro dot wisc.edu> --- I've just checked the code on 15.1 (Ubuntu Linux), and the code compiles. HOWEVER, if I change the return type of foo_t_0_ and foo_t_1_ to class(foo_t), then the problem resurfaces.
