This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/34691] [4.3/4.4/4.5 Regression] Default argument checking not performed after overload resolution with C linkage



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]