- if (complain & tf_error)
- error ("cannot deduce template arguments for %qT from ()", anode);
- return error_mark_node;
+ /* Even if there are no parameters, we might be able to deduce from
+ default template arguments. Pass TF_NONE so that we don't
+ generate redundant diagnostics. */
+ type = do_auto_deduction (type, parms, anode, tf_none,
+ adc_variable_type);
+ if (type == error_mark_node)
+ {
+ if (complain & tf_error)
+ error ("cannot deduce template arguments for %qT from ()",
+ anode);
+ return error_mark_node;
+ }