#include "tm.h"
#include "tree.h"
#include "cp-tree.h"
+#include "intl.h"
#include "obstack.h"
#include "flags.h"
#include "rtl.h"
static access_kind access_in_type (tree, tree);
static int protected_accessible_p (tree, tree, tree);
static int friend_accessible_p (tree, tree, tree);
-static int template_self_reference_p (tree, tree);
static tree dfs_get_pure_virtuals (tree, void *);
\f
const char *errstr;
};
-/* Within the scope of a template class, you can refer to the to the
- current specialization with the name of the template itself. For
- example:
-
- template <typename T> struct S { S* sp; }
-
- Returns nonzero if DECL is such a declaration in a class TYPE. */
-
-static int
-template_self_reference_p (tree type, tree decl)
-{
- return (CLASSTYPE_USE_TEMPLATE (type)
- && PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (type))
- && TREE_CODE (decl) == TYPE_DECL
- && DECL_ARTIFICIAL (decl)
- && DECL_NAME (decl) == constructor_name (type));
-}
-
/* Nonzero for a class member means that it is shared between all objects
of that class.
return 1;
if (is_overloaded_fn (t))
{
+ t = get_fns (t);
for (; t; t = OVL_NEXT (t))
{
tree fn = OVL_CURRENT (t);
}
}
- /* You must name a template base class with a template-id. */
- if (!same_type_p (type, lfi->type)
- && template_self_reference_p (type, nval))
- goto done;
-
/* If the lookup already found a match, and the new value doesn't
hide the old one, we might have an ambiguity. */
if (lfi->rval_binfo
/* Add the new value. */
lfi->ambiguous = tree_cons (NULL_TREE, nval, lfi->ambiguous);
TREE_TYPE (lfi->ambiguous) = error_mark_node;
- lfi->errstr = "request for member %qD is ambiguous";
+ lfi->errstr = G_("request for member %qD is ambiguous");
}
}
else
functions in this node were selected. This function is effectively
performing a set of member lookups as lookup_fnfield does, but
using the type being converted to as the unique key, rather than the
- field name. */
+ field name.
+ If LOOKUP_TEMPLATE_CONVS_P is TRUE, the returned TREE_LIST contains
+ the non-hidden user-defined template conversion functions too. */
tree
-lookup_conversions (tree type)
+lookup_conversions (tree type,
+ bool lookup_template_convs_p)
{
tree convs, tpl_convs;
tree list = NULL_TREE;
}
}
+ if (lookup_template_convs_p == false)
+ tpl_convs = NULL_TREE;
+
for (; tpl_convs; tpl_convs = TREE_CHAIN (tpl_convs))
{
tree probe, next;