diff options
Diffstat (limited to 'gcc/cp/name-lookup.c')
-rw-r--r-- | gcc/cp/name-lookup.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index b32ebfd9f77..e794232131d 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -4668,7 +4668,19 @@ lookup_arg_dependent (tree name, tree fns, tree args) k.namespaces = NULL_TREE; arg_assoc_args (&k, args); - POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, k.functions); + + fns = k.functions; + + if (fns + && TREE_CODE (fns) != VAR_DECL + && !is_overloaded_fn (fns)) + { + error ("argument dependent lookup finds %q+D", fns); + error (" in call to %qD", name); + fns = error_mark_node; + } + + POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, fns); } /* Add namespace to using_directives. Return NULL_TREE if nothing was |