------- Comment #13 from jason at gcc dot gnu dot org 2009-04-01 15:29 ------- Created an attachment (id=17576) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17576&action=view) Patch for testcase #1
Here's a patch that gives an error for testcase #1. But it's not clear to me that we ought to have two functions in the overload set to begin with. For instance, that means that adding void (*fp)(int) = f; gives an ambiguity error, while it doesn't on EDG. If we were properly merging the two used functions together, we would have already chosen one of the default arguments by the time we get to the call, so this patch wouldn't have two candidates to compare. I suppose that it would be feasible to keep the two functions separate until overload resolution and then fix resolve_address_of_overloaded_function to combine them. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34691