From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30624 invoked by alias); 29 Aug 2004 11:27:34 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 30580 invoked by uid 48); 29 Aug 2004 11:27:33 -0000 Date: Sun, 29 Aug 2004 11:27:00 -0000 From: "igodard at pacbell dot net" To: gcc-bugs@gcc.gnu.org Message-ID: <20040829112727.17225.igodard@pacbell.net> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/17225] New: Trsolver picks universal template over user-defined conversion X-Bugzilla-Reason: CC X-SW-Source: 2004-08/txt/msg02961.txt.bz2 List-Id: I'm not sure this is a bug or just my ignorance of the rules. #include struct R{}; struct S{}; struct T{ operator R() {return e;} operator S() {return f;} R e; S f; }; void Bar(R r) { std::cerr << "Bar\n"; } void Foo(S s) { std::cerr << "Foo direct\n";} template void Foo(U u) { std::cerr << "Foo template\n"; } int main() { T t; S s; Bar(t); Foo(s); Foo(t); } gets you: ~/ootbc/common/test/src$ a.out Bar Foo direct Foo template That is, it takes exact match over universal template, and universal template over user-defined conversion. Is this right> Ivan -- Summary: Trsolver picks universal template over user-defined conversion 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 CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17225