(lvalue_p_1 (ref, /*class rvalue ok*/ 1) != clk_none);
}
-/* Return nonzero if REF is an lvalue valid for this language;
- otherwise, print an error message and return zero. */
-
-int
-lvalue_or_else (tree ref, const char* string)
-{
- if (!lvalue_p (ref))
- {
- error ("non-lvalue in %s", string);
- return 0;
- }
- return 1;
-}
-
/* Build a TARGET_EXPR, initializing the DECL with the VALUE. */
static tree
tree bad_type = build_qualified_type (ptr_type_node, bad_quals);
if (!(complain & tf_ignore_bad_quals))
- error ("`%V' qualifiers cannot be applied to `%T'",
+ error ("%qV qualifiers cannot be applied to %qT",
bad_type, type);
}
}
tree base_binfo;
gcc_assert (!BINFO_DEPENDENT_BASE_P (binfo));
- gcc_assert (type == BINFO_TYPE (binfo));
+ gcc_assert (SAME_BINFO_TYPE_P (BINFO_TYPE (binfo), type));
BINFO_OFFSET (new_binfo) = BINFO_OFFSET (binfo);
BINFO_VIRTUALS (new_binfo) = BINFO_VIRTUALS (binfo);
case IDENTIFIER_NODE:
return false;
+ case BASELINK:
+ return (BASELINK_BINFO (t1) == BASELINK_BINFO (t2)
+ && BASELINK_ACCESS_BINFO (t1) == BASELINK_ACCESS_BINFO (t2)
+ && cp_tree_equal (BASELINK_FUNCTIONS (t1),
+ BASELINK_FUNCTIONS (t2)));
+
case TEMPLATE_PARM_INDEX:
return (TEMPLATE_PARM_IDX (t1) == TEMPLATE_PARM_IDX (t2)
&& TEMPLATE_PARM_LEVEL (t1) == TEMPLATE_PARM_LEVEL (t2)
return same_type_p (PTRMEM_CST_CLASS (t1), PTRMEM_CST_CLASS (t2));
+ case OVERLOAD:
+ if (OVL_FUNCTION (t1) != OVL_FUNCTION (t2))
+ return false;
+ return cp_tree_equal (OVL_CHAIN (t1), OVL_CHAIN (t2));
+
default:
break;
}
if (current_class_type
&& (binfo = lookup_base (current_class_type, type,
- ba_ignore | ba_quiet, NULL)))
+ ba_unique | ba_quiet, NULL)))
context = current_class_type;
else
{
return 1; /* pointer to member */
if (TREE_CODE (t) == VECTOR_TYPE)
- return 1; /* vectors are (small) arrays if scalars */
+ return 1; /* vectors are (small) arrays of scalars */
if (! CLASS_TYPE_P (t))
return 0; /* other non-class type (reference or function) */
|| !CLASS_TYPE_P (*node)
|| !TYPE_FOR_JAVA (*node))
{
- error ("`%E' attribute can only be applied to Java class definitions",
+ error ("%qE attribute can only be applied to Java class definitions",
name);
*no_add_attrs = true;
return NULL_TREE;
|| !CLASS_TYPE_P (*node)
|| *node != TYPE_MAIN_VARIANT (*node))
{
- warning ("`%E' attribute can only be applied to class definitions",
- name);
+ warning ("%qE attribute can only be applied to class definitions", name);
return NULL_TREE;
}
if (!warned++)
- warning ("`%E' is obsolete; g++ vtables are now COM-compatible by default",
+ warning ("%qE is obsolete; g++ vtables are now COM-compatible by default",
name);
return NULL_TREE;
init_priority value, so don't allow it. */
|| current_function_decl)
{
- error ("can only use `%E' attribute on file-scope definitions "
+ error ("can only use %qE attribute on file-scope definitions "
"of objects of class type", name);
*no_add_attrs = true;
return NULL_TREE;
}
else
{
- error ("`%E' attribute is not supported on this platform", name);
+ error ("%qE attribute is not supported on this platform", name);
*no_add_attrs = true;
return NULL_TREE;
}
tree
cp_walk_subtrees (tree *tp, int *walk_subtrees_p, walk_tree_fn func,
- void *data, void *htab)
+ void *data, struct pointer_set_t *pset)
{
enum tree_code code = TREE_CODE (*tp);
location_t save_locus;
#define WALK_SUBTREE(NODE) \
do \
{ \
- result = walk_tree (&(NODE), func, data, htab); \
+ result = walk_tree (&(NODE), func, data, pset); \
if (result) goto out; \
} \
while (0)
return true;
}
+/* Like "fold", but should be used whenever we might be processing the
+ body of a template. */
+
+tree
+fold_if_not_in_template (tree expr)
+{
+ /* In the body of a template, there is never any need to call
+ "fold". We will call fold later when actually instantiating the
+ template. Integral constant expressions in templates will be
+ evaluated via fold_non_dependent_expr, as necessary. */
+ return (processing_template_decl ? expr : fold (expr));
+}
+
\f
#if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007)
/* Complain that some language-specific thing hanging off a tree