+2019-05-01 Nathan Sidwell <nathan@acm.org>
+
+ * name-lookup.h (get_class_binding_direct): Change final arg to
+ bool.
+ (get_class_binding): Likewise.
+ * name-lookup.c (get_class_binding_direct): Replace TYPE_OR_FNS
+ arg with WANT_TYPE bool. Simplify.
+ (get_class_binding): Adjust final arg.
+ * decl.c (reshape_init_class): Adjust get_class_binding calls.
+
2019-04-30 Nathan Sidwell <nathan@acm.org>
* cp-objcp-common.c (cp_common_init_ts): Use MARK_TS_EXP for _EXPR
tree id = DECL_NAME (d->cur->index);
gcc_assert (id);
gcc_checking_assert (d->cur->index
- == get_class_binding (type, id, false));
+ == get_class_binding (type, id));
field = d->cur->index;
}
}
else if (TREE_CODE (d->cur->index) == IDENTIFIER_NODE)
- field = get_class_binding (type, d->cur->index, false);
+ field = get_class_binding (type, d->cur->index);
else
{
if (complain & tf_error)
Use this if you do not want lazy member creation. */
tree
-get_class_binding_direct (tree klass, tree name, int type_or_fns)
+get_class_binding_direct (tree klass, tree name, bool want_type)
{
gcc_checking_assert (RECORD_OR_UNION_TYPE_P (klass));
val = member_vec_binary_search (member_vec, lookup);
if (!val)
;
- else if (type_or_fns > 0)
- {
- if (STAT_HACK_P (val))
- val = STAT_TYPE (val);
- else if (!DECL_DECLARES_TYPE_P (val))
- val = NULL_TREE;
- }
else if (STAT_HACK_P (val))
- val = STAT_DECL (val);
+ val = want_type ? STAT_TYPE (val) : STAT_DECL (val);
+ else if (want_type && !DECL_DECLARES_TYPE_P (val))
+ val = NULL_TREE;
}
else
{
- if (member_vec && type_or_fns <= 0)
+ if (member_vec && !want_type)
val = member_vec_linear_search (member_vec, lookup);
- if (type_or_fns < 0)
- /* Don't bother looking for field. We don't want it. */;
- else if (!val || (TREE_CODE (val) == OVERLOAD
- && OVL_DEDUP_P (val)))
+ if (!val || (TREE_CODE (val) == OVERLOAD && OVL_DEDUP_P (val)))
/* Dependent using declarations are a 'field', make sure we
return that even if we saw an overload already. */
- if (tree field_val = fields_linear_search (klass, lookup,
- type_or_fns > 0))
- if (!val || TREE_CODE (field_val) == USING_DECL)
- val = field_val;
+ if (tree field_val = fields_linear_search (klass, lookup, want_type))
+ {
+ if (!val)
+ val = field_val;
+ else if (TREE_CODE (field_val) == USING_DECL)
+ val = ovl_make (field_val, val);
+ }
}
/* Extract the conversion operators asked for, unless the general
special function creation as necessary. */
tree
-get_class_binding (tree klass, tree name, int type_or_fns)
+get_class_binding (tree klass, tree name, bool want_type)
{
klass = complete_type (klass);
}
}
- return get_class_binding_direct (klass, name, type_or_fns);
+ return get_class_binding_direct (klass, name, want_type);
}
/* Find the slot containing overloads called 'NAME'. If there is no
extern tree do_class_using_decl (tree, tree);
extern tree lookup_arg_dependent (tree, tree, vec<tree, va_gc> *);
extern tree search_anon_aggr (tree, tree, bool = false);
-extern tree get_class_binding_direct (tree, tree, int type_or_fns = -1);
-extern tree get_class_binding (tree, tree, int type_or_fns = -1);
+extern tree get_class_binding_direct (tree, tree, bool want_type = false);
+extern tree get_class_binding (tree, tree, bool want_type = false);
extern tree *find_member_slot (tree klass, tree name);
extern tree *add_member_slot (tree klass, tree name);
extern void resort_type_member_vec (void *, void *,
+2019-05-01 Nathan Sidwell <nathan@acm.org>
+
+ * g++.dg/cpp0x/decltype9.C: Adjust expected diagnostics.
+
2019-04-30 Jakub Jelinek <jakub@redhat.com>
PR target/89093
// { dg-do compile { target c++11 } }
template<int> struct A { // { dg-message "defined here" }
- static int i;
+ static int i; // { dg-message "candidate" }
};
template<int N> int A<N>::i(decltype (A::i)); // { dg-error "no declaration" }
-// { dg-message "no functions" "note" { target *-*-* } .-1 }