This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/19203] New: Partial ordering failure between function reference and generic const reference
- From: "giovannibajo at libero dot it" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Dec 2004 12:19:00 -0000
- Subject: [Bug c++/19203] New: Partial ordering failure between function reference and generic const reference
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Hello:
----------------------------------------------------
template <class A>
void foo(const A& a);
template <class RET, class ARG1>
void foo(RET (&)(ARG1));
float decl(int);
void bar(void)
{
foo(decl);
}
----------------------------------------------------
lambda.cc:12: error: call of overloaded 'foo(float (&)(int))' is ambiguous
lambda.cc:2: note: candidates are: void foo(const A&) [with A = float ()(int)]
lambda.cc:5: note: void foo(RET (&)(ARG1)) [with RET = float,
ARG1 = int]
I'm pretty sure that the latter overload is more specialized than the former,
and EDG agress with me. Not sure if it is a regression.
--
Summary: Partial ordering failure between function reference and
generic const reference
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: giovannibajo at libero dot it
CC: gcc-bugs at gcc dot gnu dot org,nathan at gcc dot gnu
dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19203