diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-04 18:13:57 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-04 18:13:57 +0000 |
commit | 0e6beee6e06d0a56db543c55eb766c550b49f0a5 (patch) | |
tree | 4dbfbd02d59c34758fff83b6ac257c304de0899d /gcc/cp/name-lookup.c | |
parent | 06b9e52b8e4c071a2846fdf9931e48b640230cff (diff) | |
download | gcc-0e6beee6e06d0a56db543c55eb766c550b49f0a5.tar.gz |
PR c++/17365, DR 218
* name-lookup.c (add_function): Ignore non-functions.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@153905 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/name-lookup.c')
-rw-r--r-- | gcc/cp/name-lookup.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 25c8ac0aa62..c3f742ea2e8 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -4565,26 +4565,15 @@ add_function (struct arg_lookup *k, tree fn) total number of functions being compared, which should usually be the case. */ - /* We must find only functions, or exactly one non-function. */ - if (!k->functions) + if (!is_overloaded_fn (fn)) + /* All names except those of (possibly overloaded) functions and + function templates are ignored. */; + else if (!k->functions) k->functions = fn; else if (fn == k->functions) ; - else if (is_overloaded_fn (k->functions) && is_overloaded_fn (fn)) - k->functions = build_overload (fn, k->functions); else - { - tree f1 = OVL_CURRENT (k->functions); - tree f2 = fn; - if (is_overloaded_fn (f1)) - { - fn = f1; f1 = f2; f2 = fn; - } - error ("%q+D is not a function,", f1); - error (" conflict with %q+D", f2); - error (" in call to %qD", k->name); - return true; - } + k->functions = build_overload (fn, k->functions); return false; } |