+Tue Feb 24 01:40:24 1998 Jason Merrill <jason@yorick.cygnus.com>
+
+ * pt.c (instantiate_class_template): Don't instantiate if pedantic
+ and the args use template parms.
+
+ * pt.c (push_tinst_level): If the instantiaton uses template parms,
+ fail silently.
+ * decl.c (xref_basetypes): Do call complete_type for basetypes
+ that involve template parameters.
+
Tue Feb 24 00:36:43 1998 Jason Merrill <jason@yorick.cygnus.com>
* typeck2.c (process_init_constructor): Fix labeled init check.
continue;
}
#if 1
- /* This code replaces similar code in layout_basetypes. */
- else if (! (current_template_parms && uses_template_parms (basetype))
- && TYPE_SIZE (complete_type (basetype)) == NULL_TREE)
+ /* This code replaces similar code in layout_basetypes.
+ We put the complete_type first for implicit `typename'. */
+ else if (TYPE_SIZE (complete_type (basetype)) == NULL_TREE
+ && ! (current_template_parms && uses_template_parms (basetype)))
{
cp_error ("base class `%T' has incomplete type", basetype);
continue;
int line = lineno;
char *file = input_filename;
+ /* If the instantiation in question still has unbound template parms,
+ we don't really care if we can't instantiate it, so just return.
+ This happens with base instantiation for implicit `typename'. */
+ if (uses_template_parms (d))
+ return 0;
+
error ("template instantiation depth exceeds maximum of %d",
max_tinst_depth);
error (" (use -ftemplate-depth-NN to increase the maximum)");
if (t)
args = get_class_bindings (TREE_VALUE (t), TREE_PURPOSE (t), args);
+ if (pedantic && uses_template_parms (args))
+ /* If there are still template parameters amongst the args, then
+ we can't instantiate the type; there's no telling whether or not one
+ of the template parameters might eventually be instantiated to some
+ value that results in a specialization being used. */
+ return type;
+
TYPE_BEING_DEFINED (type) = 1;
if (! push_tinst_level (type))