https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58538
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> --- cp/pt.c convert_template_argument has this code: /* Deal with an injected-class-name used as a template template arg. */ if (requires_tmpl_type && CLASS_TYPE_P (arg)) { tree t = maybe_get_template_decl_from_type_decl (TYPE_NAME (arg)); if (TREE_CODE (t) == TEMPLATE_DECL) { if (cxx_dialect >= cxx11) /* OK under DR 1004. */; else if (complain & tf_warning_or_error) pedwarn (input_location, OPT_Wpedantic, "injected-class-name %qD" " used as template template argument", TYPE_NAME (arg)); else if (flag_pedantic_errors) t = arg; arg = t; } } So cp/semantics.c check_template_template_default_arg needs something similar.