* pt.c (unify): float doesn't match double.
* pt.c (do_type_instantiation): Handle getting a _TYPE or a
TYPE_DECL. Handle getting non-template types.
* parse.y (explicit_instantiation): Use typespec instead of
aggr template_type.
Tue Sep 2 10:27:08 1997 Richard Henderson <rth@cygnus.com>
* typeck.c (build_ptrmemfunc1): Clean up ptr->int cast warnings.
From-SVN: r15037
+Tue Sep 2 12:09:13 1997 Jason Merrill <jason@yorick.cygnus.com>
+
+ * pt.c (unify): float doesn't match double.
+
+ * pt.c (do_type_instantiation): Handle getting a _TYPE or a
+ TYPE_DECL. Handle getting non-template types.
+ * parse.y (explicit_instantiation): Use typespec instead of
+ aggr template_type.
+
+Tue Sep 2 10:27:08 1997 Richard Henderson <rth@cygnus.com>
+
+ * typeck.c (build_ptrmemfunc1): Clean up ptr->int cast warnings.
+
Mon Sep 1 13:19:04 1997 Jason Merrill <jason@yorick.cygnus.com>
* call.c (build_new_op): Strip leading REF_BIND from first operand
;
explicit_instantiation:
- TEMPLATE aggr template_type
- { do_type_instantiation ($3, NULL_TREE); }
+ TEMPLATE typespec ';'
+ { do_type_instantiation ($2.t, NULL_TREE);
+ yyungetc (';', 1); }
| TEMPLATE typed_declspecs declarator
{ tree specs = strip_attrs ($2.t);
do_decl_instantiation (specs, $3, NULL_TREE); }
{ do_decl_instantiation (NULL_TREE, $2, NULL_TREE); }
| TEMPLATE constructor_declarator
{ do_decl_instantiation (NULL_TREE, $2, NULL_TREE); }
- | SCSPEC TEMPLATE aggr template_type
- { do_type_instantiation ($4, $1); }
+ | SCSPEC TEMPLATE typespec ';'
+ { do_type_instantiation ($3.t, $1);
+ yyungetc (';', 1); }
| SCSPEC TEMPLATE typed_declspecs declarator
{ tree specs = strip_attrs ($3.t);
do_decl_instantiation (specs, $4, $1); }
TYPE_MAX_VALUE (arg), nsubsts, strict))
return 1;
}
+ else if (TREE_CODE (parm) == REAL_TYPE
+ && TYPE_MAIN_VARIANT (arg) != TYPE_MAIN_VARIANT (parm))
+ return 1;
+
/* As far as unification is concerned, this wins. Later checks
will invalidate it if necessary. */
return 0;
}
void
-do_type_instantiation (name, storage)
- tree name, storage;
+do_type_instantiation (t, storage)
+ tree t, storage;
{
- tree t = TREE_TYPE (name);
int extern_p = 0;
int nomem_p = 0;
int static_p = 0;
+ if (TREE_CODE (t) == TYPE_DECL)
+ t = TREE_TYPE (t);
+
+ if (! IS_AGGR_TYPE (t) || ! CLASSTYPE_TEMPLATE_INFO (t))
+ {
+ cp_error ("explicit instantiation of non-template type `%T'", t);
+ return;
+ }
+
complete_type (t);
/* With -fexternal-templates, explicit instantiations are treated the same
if (pfn)
{
allconstant = TREE_CONSTANT (pfn);
- allsimple = (int) initializer_constant_valid_p (pfn, TREE_TYPE (pfn));
+ allsimple = !! initializer_constant_valid_p (pfn, TREE_TYPE (pfn));
u = tree_cons (pfn_field, pfn, NULL_TREE);
}
else
{
delta2 = convert_and_check (delta_type_node, delta2);
allconstant = TREE_CONSTANT (delta2);
- allsimple = (int) initializer_constant_valid_p (delta2, TREE_TYPE (delta2));
+ allsimple = !! initializer_constant_valid_p (delta2, TREE_TYPE (delta2));
u = tree_cons (delta2_field, delta2, NULL_TREE);
}