diff options
Diffstat (limited to 'contrib/gcc/cp')
-rw-r--r-- | contrib/gcc/cp/ChangeLog | 21 | ||||
-rw-r--r-- | contrib/gcc/cp/cp-tree.h | 4 | ||||
-rw-r--r-- | contrib/gcc/cp/decl2.c | 12 | ||||
-rw-r--r-- | contrib/gcc/cp/pt.c | 18 |
4 files changed, 48 insertions, 7 deletions
diff --git a/contrib/gcc/cp/ChangeLog b/contrib/gcc/cp/ChangeLog index 82d1a8b..efa30ed 100644 --- a/contrib/gcc/cp/ChangeLog +++ b/contrib/gcc/cp/ChangeLog @@ -1,3 +1,24 @@ +Sun Oct 24 23:54:10 PDT 1999 Jeff Law (law@cygnus.com) + + * gcc-2.95.2 Released. + +1999-09-06 Mark Mitchell <mark@codesourcery.com> + + * pt.c (tsubst): Back out 1999-08-06 patch. Use fold and + decl_constant_value to simplify array bounds. + +1999-08-19 Jason Merrill <jason@yorick.cygnus.com> + + * cp-tree.h: Declare flag_use_repository. + * pt.c (do_decl_instantiation): Don't complain about duplicate + instantiation with -frepo. + (do_type_instantiation): Likewise. + +1999-08-14 Jason Merrill <jason@yorick.cygnus.com> + + * decl2.c (lookup_arg_dependent): Note that we've already checked + the current namespace. + Mon Aug 16 01:29:24 PDT 1999 Jeff Law (law@cygnus.com) * gcc-2.95.1 Released. diff --git a/contrib/gcc/cp/cp-tree.h b/contrib/gcc/cp/cp-tree.h index 7d64307..7180915 100644 --- a/contrib/gcc/cp/cp-tree.h +++ b/contrib/gcc/cp/cp-tree.h @@ -543,6 +543,10 @@ extern int flag_guiding_decls; and class qualifiers. */ extern int flag_do_squangling; +/* Nonzero means generate separate instantiation control files and juggle + them at link time. */ +extern int flag_use_repository; + /* Nonzero if we want to issue diagnostics that the standard says are not required. */ extern int flag_optional_diags; diff --git a/contrib/gcc/cp/decl2.c b/contrib/gcc/cp/decl2.c index 84f491f..d6fb7bf 100644 --- a/contrib/gcc/cp/decl2.c +++ b/contrib/gcc/cp/decl2.c @@ -4892,11 +4892,19 @@ lookup_arg_dependent (name, fns, args) tree args; { struct arg_lookup k; + k.name = name; k.functions = fns; - k.namespaces = NULL_TREE; k.classes = NULL_TREE; - + + /* Note that we've already looked at the current namespace during normal + unqualified lookup, unless we found a decl in function scope. */ + if (fns && ! TREE_PERMANENT (OVL_CURRENT (fns))) + k.namespaces = NULL_TREE; + else + k.namespaces = scratch_tree_cons (current_decl_namespace (), + NULL_TREE, NULL_TREE); + push_scratch_obstack (); arg_assoc_args (&k, args); pop_obstacks (); diff --git a/contrib/gcc/cp/pt.c b/contrib/gcc/cp/pt.c index 47fa99a..ddbea0a 100644 --- a/contrib/gcc/cp/pt.c +++ b/contrib/gcc/cp/pt.c @@ -6130,6 +6130,11 @@ tsubst (t, args, complain, in_decl) if (max == error_mark_node) return error_mark_node; + /* See if we can reduce this expression to something simpler. */ + max = maybe_fold_nontype_arg (max); + if (!processing_template_decl && TREE_READONLY_DECL_P (max)) + max = decl_constant_value (max); + if (processing_template_decl /* When providing explicit arguments to a template function, but leaving some arguments for subsequent @@ -6137,8 +6142,11 @@ tsubst (t, args, complain, in_decl) not PROCESSING_TEMPLATE_DECL. */ || TREE_CODE (max) != INTEGER_CST) { - return build_index_type (build_min - (MINUS_EXPR, sizetype, max, integer_one_node)); + tree itype = make_node (INTEGER_TYPE); + TYPE_MIN_VALUE (itype) = size_zero_node; + TYPE_MAX_VALUE (itype) = build_min (MINUS_EXPR, sizetype, max, + integer_one_node); + return itype; } if (integer_zerop (omax)) @@ -8924,7 +8932,7 @@ do_decl_instantiation (declspecs, declarator, storage) We check DECL_INTERFACE_KNOWN so as not to complain when the first instantiation was `extern' and the second is not, and EXTERN_P for the opposite case. */ - if (DECL_INTERFACE_KNOWN (result) && !extern_p) + if (DECL_INTERFACE_KNOWN (result) && !extern_p && !flag_use_repository) cp_pedwarn ("duplicate explicit instantiation of `%#D'", result); /* If we've already instantiated the template, just return now. */ @@ -9052,8 +9060,8 @@ do_type_instantiation (t, storage) If CLASSTYPE_INTERFACE_ONLY, then the first explicit instantiation was `extern', and if EXTERN_P then the second is. Both cases are OK. */ - if (!CLASSTYPE_INTERFACE_ONLY (t) && !extern_p) - cp_error ("duplicate explicit instantiation of `%#T'", t); + if (!CLASSTYPE_INTERFACE_ONLY (t) && !extern_p && !flag_use_repository) + cp_pedwarn ("duplicate explicit instantiation of `%#T'", t); /* If we've already instantiated the template, just return now. */ if (!CLASSTYPE_INTERFACE_ONLY (t)) |