GCC is right. An empty template argument list, <>
for a function template is allowed to be omitted ([temp.arg.explicit]/4). In other cases, the template argument list is generally required in order to name a particular specialization of a template, even if it is empty. See the grammar for simple-template-id, [temp.names]/1.
As a limited exception to the rule, if the name of a class template without a template argument list appears in a context where a concrete type is required, it is known as a "placeholder for a deduced class type" and this is only allowed in specific contexts listed in [dcl.type.class.deduct]. The most common one is a variable declaration like std::pair p("foo", 1)
where the compiler will deduce std::pair<const char*, int>
in C++17 and later.
In your code, you are trying to refer to a particular specialization of class template Test
, without specifying the template argument list, and not in a context where the template arguments can be deduced. Therefore, it's not allowed.