cp-tree.h (enum tsubst_flags_t): Add tf_user.
* cp-tree.h (enum tsubst_flags_t): Add tf_user. * decl.c (make_typename_type): Pass it. * pt.c (lookup_template_class): Use it. (resolve_typename_type): Pass it. * semantics.c (finish_template_type): Pass it. From-SVN: r69793
This commit is contained in:
parent
e884d397fb
commit
42eaed4985
|
@ -1,3 +1,11 @@
|
|||
2003-07-25 Nathan Sidwell <nathan@codesourcery.com>
|
||||
|
||||
* cp-tree.h (enum tsubst_flags_t): Add tf_user.
|
||||
* decl.c (make_typename_type): Pass it.
|
||||
* pt.c (lookup_template_class): Use it.
|
||||
(resolve_typename_type): Pass it.
|
||||
* semantics.c (finish_template_type): Pass it.
|
||||
|
||||
2003-07-25 Nathan Sidwell <nathan@codesourcery.com>
|
||||
|
||||
PR c++/11617
|
||||
|
|
|
@ -3054,8 +3054,10 @@ typedef enum tsubst_flags_t {
|
|||
tf_ignore_bad_quals = 1 << 2, /* ignore bad cvr qualifiers */
|
||||
tf_keep_type_decl = 1 << 3, /* retain typedef type decls
|
||||
(make_typename_type use) */
|
||||
tf_ptrmem_ok = 1 << 4 /* pointers to member ok (internal
|
||||
instantiate_type use) */
|
||||
tf_ptrmem_ok = 1 << 4, /* pointers to member ok (internal
|
||||
instantiate_type use) */
|
||||
tf_user = 1 << 5 /* Found template must be a user template
|
||||
(lookup_template_class use) */
|
||||
} tsubst_flags_t;
|
||||
|
||||
/* The kind of checking we can do looking in a class hierarchy. */
|
||||
|
|
|
@ -5523,7 +5523,7 @@ make_typename_type (tree context, tree name, tsubst_flags_t complain)
|
|||
TREE_OPERAND (fullname, 1),
|
||||
NULL_TREE, context,
|
||||
/*entering_scope=*/0,
|
||||
tf_error | tf_warning);
|
||||
tf_error | tf_warning | tf_user);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
19
gcc/cp/pt.c
19
gcc/cp/pt.c
|
@ -3957,8 +3957,11 @@ lookup_template_class (tree d1,
|
|||
{
|
||||
tree template = NULL_TREE, parmlist;
|
||||
tree t;
|
||||
|
||||
|
||||
timevar_push (TV_NAME_LOOKUP);
|
||||
my_friendly_assert ((!arglist || TREE_CODE (arglist) == TREE_LIST)
|
||||
== ((complain & tf_user) != 0), 20030724);
|
||||
|
||||
if (TREE_CODE (d1) == IDENTIFIER_NODE)
|
||||
{
|
||||
if (IDENTIFIER_VALUE (d1)
|
||||
|
@ -4018,11 +4021,10 @@ lookup_template_class (tree d1,
|
|||
}
|
||||
|
||||
if (TREE_CODE (template) != TEMPLATE_DECL
|
||||
/* If we're called from the parser, make sure it's a user visible
|
||||
template. */
|
||||
|| ((!arglist || TREE_CODE (arglist) == TREE_LIST)
|
||||
&& !DECL_TEMPLATE_PARM_P (template)
|
||||
&& !PRIMARY_TEMPLATE_P (template)))
|
||||
/* Make sure it's a user visible template, if it was named by
|
||||
the user. */
|
||||
|| ((complain & tf_user) && !DECL_TEMPLATE_PARM_P (template)
|
||||
&& !PRIMARY_TEMPLATE_P (template)))
|
||||
{
|
||||
if (complain & tf_error)
|
||||
{
|
||||
|
@ -4033,6 +4035,8 @@ lookup_template_class (tree d1,
|
|||
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node);
|
||||
}
|
||||
|
||||
complain &= ~tf_user;
|
||||
|
||||
if (DECL_TEMPLATE_TEMPLATE_PARM_P (template))
|
||||
{
|
||||
/* Create a new TEMPLATE_DECL and TEMPLATE_TEMPLATE_PARM node to store
|
||||
|
@ -11795,8 +11799,7 @@ resolve_typename_type (tree type, bool only_current_p)
|
|||
args = TREE_OPERAND (TYPENAME_TYPE_FULLNAME (type), 1);
|
||||
/* Instantiate the template. */
|
||||
type = lookup_template_class (tmpl, args, NULL_TREE, NULL_TREE,
|
||||
/*entering_scope=*/0,
|
||||
tf_error);
|
||||
/*entering_scope=*/0, tf_error | tf_user);
|
||||
}
|
||||
else
|
||||
type = error_mark_node;
|
||||
|
|
|
@ -2183,8 +2183,8 @@ finish_template_type (tree name, tree args, int entering_scope)
|
|||
tree decl;
|
||||
|
||||
decl = lookup_template_class (name, args,
|
||||
NULL_TREE, NULL_TREE,
|
||||
entering_scope, /*complain=*/1);
|
||||
NULL_TREE, NULL_TREE, entering_scope,
|
||||
tf_error | tf_warning | tf_user);
|
||||
if (decl != error_mark_node)
|
||||
decl = TYPE_STUB_DECL (decl);
|
||||
|
||||
|
|
Loading…
Reference in New Issue