https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101710
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Changing: if constexpr(type_info<T>.has_attribute_helper<can_t_use_default_null_ptr>()&&type_info<T>.not_has_has_attribute_helper<force_use_default_null_ptr>()) to: if constexpr(type_info<T>.template has_attribute_helper<can_t_use_default_null_ptr>()&&type_info<T>.template not_has_has_attribute_helper<force_use_default_null_ptr>()) Fixes many of the errors Note the use of template. Note there are cases where GCC does not realize the template keyword is not needed but I don't know if it is actually needed in this case or not. I suspect it is.