mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-25 03:55:30 +08:00
cp-tree.h (tf_warning_or_error): Renamed from tf_warn_or_error.
* cp-tree.h (tf_warning_or_error): Renamed from tf_warn_or_error. (cp_build_qualified_type): Propogate renaming. * call.c (convert_like_real): Likewise. * cvt.c (cp_convert_to_pointer, convert_to_reference): Likewise. * decl.c (make_typename_type, grokdeclarator): Likewise. * pt.c (tsubst_friend_function, instantiate_class_template, tsubst_default_argument, instantiate_decl, tsubst_initializer_list, tsubst_enum): Likewise. * semantics.c (finish_template_type): Likewise. * typeck.c (build_ptrmemfunc, convert_for_assignment): Likewise. From-SVN: r110727
This commit is contained in:
parent
6defecc2d3
commit
23fca1f587
@ -1,3 +1,16 @@
|
||||
2006-02-07 Gabriel Dos Reis <gdr@integrable-solutions.net>
|
||||
|
||||
* cp-tree.h (tf_warning_or_error): Renamed from tf_warn_or_error.
|
||||
(cp_build_qualified_type): Propogate renaming.
|
||||
* call.c (convert_like_real): Likewise.
|
||||
* cvt.c (cp_convert_to_pointer, convert_to_reference): Likewise.
|
||||
* decl.c (make_typename_type, grokdeclarator): Likewise.
|
||||
* pt.c (tsubst_friend_function, instantiate_class_template,
|
||||
tsubst_default_argument, instantiate_decl,
|
||||
tsubst_initializer_list, tsubst_enum): Likewise.
|
||||
* semantics.c (finish_template_type): Likewise.
|
||||
* typeck.c (build_ptrmemfunc, convert_for_assignment): Likewise.
|
||||
|
||||
2006-02-07 Dirk Mueller <dmueller@suse.com>
|
||||
|
||||
* typeck.c (build_binary_op): Annotate div-by-zero
|
||||
|
@ -4279,7 +4279,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
|
||||
}
|
||||
case ck_identity:
|
||||
if (type_unknown_p (expr))
|
||||
expr = instantiate_type (totype, expr, tf_warn_or_error);
|
||||
expr = instantiate_type (totype, expr, tf_warning_or_error);
|
||||
/* Convert a constant to its underlying value, unless we are
|
||||
about to bind it to a reference, in which case we need to
|
||||
leave it as an lvalue. */
|
||||
|
@ -3111,7 +3111,7 @@ typedef enum tsubst_flags_t {
|
||||
not actually performing the
|
||||
conversion. */
|
||||
/* Convenient substitution flags combinations. */
|
||||
tf_warn_or_error = tf_warning | tf_error
|
||||
tf_warning_or_error = tf_warning | tf_error
|
||||
} tsubst_flags_t;
|
||||
|
||||
/* The kind of checking we can do looking in a class hierarchy. */
|
||||
@ -4274,7 +4274,7 @@ extern tree make_ptrmem_cst (tree, tree);
|
||||
extern tree cp_build_type_attribute_variant (tree, tree);
|
||||
extern tree cp_build_qualified_type_real (tree, int, tsubst_flags_t);
|
||||
#define cp_build_qualified_type(TYPE, QUALS) \
|
||||
cp_build_qualified_type_real ((TYPE), (QUALS), tf_warn_or_error)
|
||||
cp_build_qualified_type_real ((TYPE), (QUALS), tf_warning_or_error)
|
||||
extern special_function_kind special_function_p (tree);
|
||||
extern int count_trees (tree);
|
||||
extern int char_type_p (tree);
|
||||
|
@ -280,7 +280,7 @@ cp_convert_to_pointer (tree type, tree expr, bool force)
|
||||
}
|
||||
|
||||
if (type_unknown_p (expr))
|
||||
return instantiate_type (type, expr, tf_warn_or_error);
|
||||
return instantiate_type (type, expr, tf_warning_or_error);
|
||||
|
||||
error ("cannot convert %qE from type %qT to type %qT",
|
||||
expr, intype, type);
|
||||
@ -451,7 +451,7 @@ convert_to_reference (tree reftype, tree expr, int convtype,
|
||||
&& TREE_TYPE (expr) == unknown_type_node)
|
||||
expr = instantiate_type (type, expr,
|
||||
(flags & LOOKUP_COMPLAIN)
|
||||
? tf_warn_or_error : tf_none);
|
||||
? tf_warning_or_error : tf_none);
|
||||
|
||||
if (expr == error_mark_node)
|
||||
return error_mark_node;
|
||||
|
@ -2672,7 +2672,7 @@ make_typename_type (tree context, tree name, enum tag_types tag_type,
|
||||
TREE_OPERAND (fullname, 1),
|
||||
NULL_TREE, context,
|
||||
/*entering_scope=*/0,
|
||||
tf_warn_or_error | tf_user);
|
||||
tf_warning_or_error | tf_user);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -7112,7 +7112,7 @@ grokdeclarator (const cp_declarator *declarator,
|
||||
type_quals |= cp_type_quals (type);
|
||||
type = cp_build_qualified_type_real
|
||||
(type, type_quals, ((typedef_decl && !DECL_ARTIFICIAL (typedef_decl)
|
||||
? tf_ignore_bad_quals : 0) | tf_warn_or_error));
|
||||
? tf_ignore_bad_quals : 0) | tf_warning_or_error));
|
||||
/* We might have ignored or rejected some of the qualifiers. */
|
||||
type_quals = cp_type_quals (type);
|
||||
|
||||
|
38
gcc/cp/pt.c
38
gcc/cp/pt.c
@ -5152,13 +5152,13 @@ tsubst_friend_function (tree decl, tree args)
|
||||
current cless with same name. */
|
||||
push_nested_namespace (ns);
|
||||
fns = tsubst_expr (DECL_TI_TEMPLATE (decl), args,
|
||||
tf_warn_or_error, NULL_TREE);
|
||||
tf_warning_or_error, NULL_TREE);
|
||||
pop_nested_namespace (ns);
|
||||
arglist = tsubst (DECL_TI_ARGS (decl), args,
|
||||
tf_warn_or_error, NULL_TREE);
|
||||
tf_warning_or_error, NULL_TREE);
|
||||
template_id = lookup_template_function (fns, arglist);
|
||||
|
||||
new_friend = tsubst (decl, args, tf_warn_or_error, NULL_TREE);
|
||||
new_friend = tsubst (decl, args, tf_warning_or_error, NULL_TREE);
|
||||
tmpl = determine_specialization (template_id, new_friend,
|
||||
&new_args,
|
||||
/*need_member_template=*/0,
|
||||
@ -5166,7 +5166,7 @@ tsubst_friend_function (tree decl, tree args)
|
||||
return instantiate_template (tmpl, new_args, tf_error);
|
||||
}
|
||||
|
||||
new_friend = tsubst (decl, args, tf_warn_or_error, NULL_TREE);
|
||||
new_friend = tsubst (decl, args, tf_warning_or_error, NULL_TREE);
|
||||
|
||||
/* The NEW_FRIEND will look like an instantiation, to the
|
||||
compiler, but is not an instantiation from the point of view of
|
||||
@ -5419,7 +5419,7 @@ tsubst_friend_class (tree friend_tmpl, tree args)
|
||||
{
|
||||
tree parms;
|
||||
parms = tsubst_template_parms (DECL_TEMPLATE_PARMS (friend_tmpl),
|
||||
args, tf_warn_or_error);
|
||||
args, tf_warning_or_error);
|
||||
redeclare_class_template (TREE_TYPE (tmpl), parms);
|
||||
}
|
||||
|
||||
@ -5430,7 +5430,7 @@ tsubst_friend_class (tree friend_tmpl, tree args)
|
||||
/* The friend template has not already been declared. In this
|
||||
case, the instantiation of the template class will cause the
|
||||
injection of this template into the global scope. */
|
||||
tmpl = tsubst (friend_tmpl, args, tf_warn_or_error, NULL_TREE);
|
||||
tmpl = tsubst (friend_tmpl, args, tf_warning_or_error, NULL_TREE);
|
||||
|
||||
/* The new TMPL is not an instantiation of anything, so we
|
||||
forget its origins. We don't reset CLASSTYPE_TI_TEMPLATE for
|
||||
@ -5722,7 +5722,7 @@ instantiate_class_template (tree type)
|
||||
|
||||
if (TREE_CODE (t) == TEMPLATE_DECL)
|
||||
++processing_template_decl;
|
||||
r = tsubst (t, args, tf_warn_or_error, NULL_TREE);
|
||||
r = tsubst (t, args, tf_warning_or_error, NULL_TREE);
|
||||
if (TREE_CODE (t) == TEMPLATE_DECL)
|
||||
--processing_template_decl;
|
||||
if (TREE_CODE (r) == VAR_DECL)
|
||||
@ -5796,7 +5796,7 @@ instantiate_class_template (tree type)
|
||||
{
|
||||
/* template <class T> friend class C::D; */
|
||||
friend_type = tsubst (friend_type, args,
|
||||
tf_warn_or_error, NULL_TREE);
|
||||
tf_warning_or_error, NULL_TREE);
|
||||
if (TREE_CODE (friend_type) == TEMPLATE_DECL)
|
||||
friend_type = TREE_TYPE (friend_type);
|
||||
adjust_processing_template_decl = true;
|
||||
@ -5813,7 +5813,7 @@ instantiate_class_template (tree type)
|
||||
|
||||
otherwise. */
|
||||
friend_type = tsubst (friend_type, args,
|
||||
tf_warn_or_error, NULL_TREE);
|
||||
tf_warning_or_error, NULL_TREE);
|
||||
/* Bump processing_template_decl for correct
|
||||
dependent_type_p calculation. */
|
||||
++processing_template_decl;
|
||||
@ -5842,7 +5842,7 @@ instantiate_class_template (tree type)
|
||||
else if (uses_template_parms (friend_type))
|
||||
/* friend class C<T>; */
|
||||
friend_type = tsubst (friend_type, args,
|
||||
tf_warn_or_error, NULL_TREE);
|
||||
tf_warning_or_error, NULL_TREE);
|
||||
/* Otherwise it's
|
||||
|
||||
friend class C;
|
||||
@ -6151,7 +6151,7 @@ tsubst_default_argument (tree fn, tree type, tree arg)
|
||||
|
||||
push_deferring_access_checks(dk_no_deferred);
|
||||
arg = tsubst_expr (arg, DECL_TI_ARGS (fn),
|
||||
tf_warn_or_error, NULL_TREE);
|
||||
tf_warning_or_error, NULL_TREE);
|
||||
pop_deferring_access_checks();
|
||||
|
||||
/* Restore the "this" pointer. */
|
||||
@ -11635,16 +11635,16 @@ instantiate_decl (tree d, int defer_ok,
|
||||
|
||||
if (TREE_CODE (gen) == FUNCTION_DECL)
|
||||
{
|
||||
tsubst (DECL_ARGUMENTS (gen), gen_args, tf_warn_or_error, d);
|
||||
tsubst (DECL_ARGUMENTS (gen), gen_args, tf_warning_or_error, d);
|
||||
tsubst (TYPE_RAISES_EXCEPTIONS (type), gen_args,
|
||||
tf_warn_or_error, d);
|
||||
tf_warning_or_error, d);
|
||||
/* Don't simply tsubst the function type, as that will give
|
||||
duplicate warnings about poor parameter qualifications.
|
||||
The function arguments are the same as the decl_arguments
|
||||
without the top level cv qualifiers. */
|
||||
type = TREE_TYPE (type);
|
||||
}
|
||||
tsubst (type, gen_args, tf_warn_or_error, d);
|
||||
tsubst (type, gen_args, tf_warning_or_error, d);
|
||||
|
||||
pop_access_scope (d);
|
||||
}
|
||||
@ -11690,7 +11690,7 @@ instantiate_decl (tree d, int defer_ok,
|
||||
push_nested_class (DECL_CONTEXT (d));
|
||||
init = tsubst_expr (DECL_INITIAL (code_pattern),
|
||||
args,
|
||||
tf_warn_or_error, NULL_TREE);
|
||||
tf_warning_or_error, NULL_TREE);
|
||||
DECL_INITIAL (d) = init;
|
||||
cp_finish_decl (d, init, /*asmspec_tree=*/NULL_TREE,
|
||||
LOOKUP_ONLYCONVERTING);
|
||||
@ -11812,7 +11812,7 @@ instantiate_decl (tree d, int defer_ok,
|
||||
|
||||
/* Substitute into the body of the function. */
|
||||
tsubst_expr (DECL_SAVED_TREE (code_pattern), args,
|
||||
tf_warn_or_error, tmpl);
|
||||
tf_warning_or_error, tmpl);
|
||||
|
||||
/* We don't need the local specializations any more. */
|
||||
htab_delete (local_specializations);
|
||||
@ -11959,13 +11959,13 @@ tsubst_initializer_list (tree t, tree argvec)
|
||||
tree decl;
|
||||
tree init;
|
||||
|
||||
decl = tsubst_copy (TREE_PURPOSE (t), argvec, tf_warn_or_error,
|
||||
decl = tsubst_copy (TREE_PURPOSE (t), argvec, tf_warning_or_error,
|
||||
NULL_TREE);
|
||||
decl = expand_member_init (decl);
|
||||
if (decl && !DECL_P (decl))
|
||||
in_base_initializer = 1;
|
||||
|
||||
init = tsubst_expr (TREE_VALUE (t), argvec, tf_warn_or_error,
|
||||
init = tsubst_expr (TREE_VALUE (t), argvec, tf_warning_or_error,
|
||||
NULL_TREE);
|
||||
in_base_initializer = 0;
|
||||
|
||||
@ -12010,7 +12010,7 @@ tsubst_enum (tree tag, tree newtag, tree args)
|
||||
/* Note that in a template enum, the TREE_VALUE is the
|
||||
CONST_DECL, not the corresponding INTEGER_CST. */
|
||||
value = tsubst_expr (DECL_INITIAL (decl),
|
||||
args, tf_warn_or_error, NULL_TREE);
|
||||
args, tf_warning_or_error, NULL_TREE);
|
||||
|
||||
/* Give this enumeration constant the correct access. */
|
||||
set_current_access_from_decl (decl);
|
||||
|
@ -2324,7 +2324,7 @@ finish_template_type (tree name, tree args, int entering_scope)
|
||||
|
||||
decl = lookup_template_class (name, args,
|
||||
NULL_TREE, NULL_TREE, entering_scope,
|
||||
tf_warn_or_error | tf_user);
|
||||
tf_warning_or_error | tf_user);
|
||||
if (decl != error_mark_node)
|
||||
decl = TYPE_STUB_DECL (decl);
|
||||
|
||||
|
@ -5878,7 +5878,7 @@ build_ptrmemfunc (tree type, tree pfn, int force, bool c_cast_p)
|
||||
}
|
||||
|
||||
if (type_unknown_p (pfn))
|
||||
return instantiate_type (type, pfn, tf_warn_or_error);
|
||||
return instantiate_type (type, pfn, tf_warning_or_error);
|
||||
|
||||
fn = TREE_OPERAND (pfn, 0);
|
||||
gcc_assert (TREE_CODE (fn) == FUNCTION_DECL
|
||||
@ -6069,7 +6069,7 @@ convert_for_assignment (tree type, tree rhs,
|
||||
overloaded function. Call instantiate_type to get error
|
||||
messages. */
|
||||
if (rhstype == unknown_type_node)
|
||||
instantiate_type (type, rhs, tf_warn_or_error);
|
||||
instantiate_type (type, rhs, tf_warning_or_error);
|
||||
else if (fndecl)
|
||||
error ("cannot convert %qT to %qT for argument %qP to %qD",
|
||||
rhstype, type, parmnum, fndecl);
|
||||
|
Loading…
Reference in New Issue
Block a user