This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/24492] New: "match anything" template wins over conversion operator
- From: "igodard at pacbell dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Oct 2005 14:22:38 -0000
- Subject: [Bug c++/24492] New: "match anything" template wins over conversion operator
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
In:
#include <iostream>
struct foo {};
struct bar { operator foo() {} };
template<typename T>
void baz(const T& f) { std::cerr << "template\n"; }
void baz(foo f) { std::cerr << "convert\n"; }
int main() {
bar b;
baz(b);
}
you get:
~/ootbc/members/src$ a.out
template
Is this correct?
Ivan
--
Summary: "match anything" template wins over conversion operator
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: igodard at pacbell dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24492