https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103555
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- DR 1200 seems like in this area. http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1200 But there is a still an open defect report which mentions searching base classes before template parameters even. http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#459 So maybe it is related to that.