aboutsummaryrefslogtreecommitdiff
path: root/contrib/gcc/cp/pt.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/gcc/cp/pt.c')
-rw-r--r--contrib/gcc/cp/pt.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/contrib/gcc/cp/pt.c b/contrib/gcc/cp/pt.c
index ddbea0ac9866..47fa99a5c431 100644
--- a/contrib/gcc/cp/pt.c
+++ b/contrib/gcc/cp/pt.c
@@ -6130,11 +6130,6 @@ 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
@@ -6142,11 +6137,8 @@ tsubst (t, args, complain, in_decl)
not PROCESSING_TEMPLATE_DECL. */
|| TREE_CODE (max) != INTEGER_CST)
{
- 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;
+ return build_index_type (build_min
+ (MINUS_EXPR, sizetype, max, integer_one_node));
}
if (integer_zerop (omax))
@@ -8932,7 +8924,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 && !flag_use_repository)
+ if (DECL_INTERFACE_KNOWN (result) && !extern_p)
cp_pedwarn ("duplicate explicit instantiation of `%#D'", result);
/* If we've already instantiated the template, just return now. */
@@ -9060,8 +9052,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 && !flag_use_repository)
- cp_pedwarn ("duplicate explicit instantiation of `%#T'", t);
+ if (!CLASSTYPE_INTERFACE_ONLY (t) && !extern_p)
+ cp_error ("duplicate explicit instantiation of `%#T'", t);
/* If we've already instantiated the template, just return now. */
if (!CLASSTYPE_INTERFACE_ONLY (t))