https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102590
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- My bet is gcc mistaken it for being a dependent type which meaning you can use the template keyword to workaround the issue. Also gcc 8.x series is over 3 years old so this might be fixed already in a newer version of gcc.