This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/34691] [4.3/4.4/4.5 Regression] Default argument checking not performed after overload resolution with C linkage
- From: "jason at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Apr 2009 15:29:05 -0000
- Subject: [Bug c++/34691] [4.3/4.4/4.5 Regression] Default argument checking not performed after overload resolution with C linkage
- References: <bug-34691-15588@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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