2017-05-26 Nathan Sidwell <nathan@acm.org>
+ * call.c (build_operator_new_call): Do namelookup and ADL here.
+ (build_new_op_1): Likewise.
+ * name-lookup.h (lookup_function_nonclass): Delete declaration.
+ (do_using_directive): Likewise.
+ * name-lookup.c (set_namespace_binding, push_local_binding): Don't
+ declare early.
+ (struct scope_binding): Delete.
+ (EMPTY_SCOPE_BINDING): Delete.
+ (set_decl_namespace): Use OVL_P.
+ (finish_local_using_decl): Lose unnecesary checks.
+ (lookup_function_nonclass): Delete.
+ (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
+
* cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
(ovl_iterator): Add allow_inner field. Adjust ctor. Make
unduplicatable.
up in the global scope.
we disregard block-scope declarations of "operator new". */
- fns = lookup_function_nonclass (fnname, *args, /*block_p=*/false);
+ fns = lookup_name_real (fnname, 0, 1, /*block_p=*/false, 0, 0);
+ fns = lookup_arg_dependent (fnname, fns, *args);
if (align_arg)
{
/* Add namespace-scope operators to the list of functions to
consider. */
if (!memonly)
- add_candidates (lookup_function_nonclass (fnname, arglist,
- /*block_p=*/true),
- NULL_TREE, arglist, NULL_TREE,
- NULL_TREE, false, NULL_TREE, NULL_TREE,
- flags, &candidates, complain);
+ {
+ tree fns = lookup_name_real (fnname, 0, 1, /*block_p=*/true, 0, 0);
+ fns = lookup_arg_dependent (fnname, fns, arglist);
+ add_candidates (fns, NULL_TREE, arglist, NULL_TREE,
+ NULL_TREE, false, NULL_TREE, NULL_TREE,
+ flags, &candidates, complain);
+ }
args[0] = arg1;
args[1] = arg2;
static cp_binding_level *innermost_nonclass_level (void);
static void set_identifier_type_value_with_scope (tree id, tree decl,
cp_binding_level *b);
-static void set_namespace_binding (tree scope, tree name, tree val);
-static void push_local_binding (tree, tree, bool);
-
-/* The bindings for a particular name in a particular scope. */
-
-struct scope_binding {
- tree value;
- tree type;
-};
-#define EMPTY_SCOPE_BINDING { NULL_TREE, NULL_TREE }
/* Create a local binding level for NAME. */
print_candidates (old);
return;
}
- if (!is_overloaded_fn (decl))
+ if (!OVL_P (decl))
{
/* We might have found OLD in an inline namespace inside SCOPE. */
if (TREE_CODE (decl) == TREE_CODE (old))
return;
}
/* Since decl is a function, old should contain a function decl. */
- if (!is_overloaded_fn (old))
+ if (!OVL_P (old))
goto complain;
/* We handle these in check_explicit_instantiation_namespace. */
if (processing_explicit_instantiation)
return saw_vis;
}
+
/* Temporarily set the namespace for the current declaration. */
void
if (decl == NULL_TREE)
return;
- gcc_assert (building_stmt_list_p ());
- if (building_stmt_list_p ()
- && at_function_scope_p ())
- add_decl_expr (decl);
+ add_decl_expr (decl);
cxx_binding *binding = find_local_binding (current_binding_level, name);
tree value = binding ? binding->value : NULL_TREE;
}
tree
-lookup_function_nonclass (tree name, vec<tree, va_gc> *args, bool block_p)
-{
- return
- lookup_arg_dependent (name,
- lookup_name_real (name, 0, 1, block_p, 0, 0),
- args);
-}
-
-tree
lookup_name (tree name)
{
return lookup_name_real (name, 0, 0, /*block_p=*/true, 0, 0);
if (context == global_namespace)
context = NULL_TREE;
- if (BASELINK_P (t))
- t = BASELINK_FUNCTIONS (t);
+ t = MAYBE_BASELINK_FUNCTIONS (t);
/* FIXME: Handle TEMPLATE_DECLs. */
for (lkp_iterator iter (t); iter; ++iter)
extern tree lookup_qualified_name (tree, tree, int, bool, /*hidden*/bool = false);
extern tree lookup_name_nonclass (tree);
extern bool is_local_extern (tree);
-extern tree lookup_function_nonclass (tree, vec<tree, va_gc> *, bool);
extern bool pushdecl_class_level (tree);
extern tree pushdecl_namespace_level (tree, bool);
extern bool push_class_level_binding (tree, tree);
extern void pop_decl_namespace (void);
extern void do_namespace_alias (tree, tree);
extern tree do_class_using_decl (tree, tree);
-extern void do_using_directive (tree);
extern tree lookup_arg_dependent (tree, tree, vec<tree, va_gc> *);
extern tree innermost_non_namespace_value (tree);
extern cxx_binding *outer_binding (tree, cxx_binding *, bool);
+2017-05-26 Nathan Sidwell <nathan@acm.org>
+
+ * libcp1plugin.cc (plugin_add_using_namespace): Call
+ finish_namespace_using_directive.
+
2017-05-25 Nathan Sidwell <nathan@acm.org>
* libcp1plugin.cc (plugin_make_namespace_inline): Check and set
gcc_assert (TREE_CODE (used_ns) == NAMESPACE_DECL);
- do_using_directive (used_ns);
+ finish_namespace_using_directive (used_ns, NULL_TREE);
return 1;
}