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++/12164] Unambiguous template reported as ambiguous - sometimes


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12164



------- Additional Comments From igodard at pacbell dot net  2003-09-04 18:40 -------
Subject: Re:  Unambiguous template reported as ambiguous - sometimes

Why it should work is a good question, and if it consistently didn't work I
wouldn't have put a report in. But in trying to figure out what was wrong I
produced a test case (3rd attachment) with exactly the same resolution
requirements, and that did work. So I'll leave to the language mavens
whether it should work or not. But it is a bug if it works sometimes, which
seems to be the case.

IMHO, I think it should work by intuition if not by the language
specification, because I see default arguments as second class citizens.
That is, an explicit match on an explicit argument should count more than a
match on a default argument. But whether the standard says so I have no
idea - I filed because either both cases should work or neither, but in fact
one did and one didn't.

Ivan


----- Original Message ----- 
From: "bangerth at dealii dot org" <gcc-bugzilla@gcc.gnu.org>
To: <igodard@pacbell.net>
Sent: Thursday, September 04, 2003 7:34 AM
Subject: [Bug c++/12164] Unambiguous template reported as ambiguous -
sometimes


> PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12164
>
>
> bangerth at dealii dot org changed:
>
>            What    |Removed                     |Added
> --------------------------------------------------------------------------
--
>              Status|UNCONFIRMED                 |WAITING
>
>
> ------- Additional Comments From bangerth at dealii dot org  2003-09-04
14:34 -------
> Here's a reduced testcase:
> ----------------------------------------------- 
> struct X {};
>
> template<typename C, typename T, typename S = void, typename P = void>
> class R;
>
> template<typename T, typename S>
> class R<X, T, S, void>  {};
>
> template<typename C, typename T>
> class R<C, T, void, void>  {};
>
> template class R<X,int,void,void>;
> ---------------------------------------------- 
>
> It indeed fails with gcc 3.2, 3.3 and mainline. It compiles with icc,
though.
>
> However, I must admit that I fail to see why it should succeed -- both
versions of
> R are matches for the instantiation. Why do you think that the code should
compile,
> and which version should be taken?
>
> W.
>
>
>
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.


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