public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/12838] New: Error:"ambiguous class template instantiation" when actually there's no ambiguity
@ 2003-10-30  9:31 peter at sanbolic dot com
  2003-10-30  9:36 ` [Bug c++/12838] " pinskia at gcc dot gnu dot org
  2003-10-30 14:29 ` lerdsuwa at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: peter at sanbolic dot com @ 2003-10-30  9:31 UTC (permalink / raw)
  To: gcc-bugs

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

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

           Summary: Error:"ambiguous class template instantiation" when
                    actually there's no ambiguity
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: peter at sanbolic dot com
                CC: gcc-bugs at gcc dot gnu dot org

-------TEST CASE------------
template<class t1, class t2=void>
struct s1 {};

template<class t1, class t2>
struct s2;

template<template<class t> class x, class t1, class t2>
struct s2<x<t1>, t2> {};

template<template<class t1, class t2> class x, class t1, class t2, class t3>
struct s2<x<t1, t2>, t3> {};

s2<s1<int, void>, float> y;

int main() { return 0; }

------- END TEST CASE------------
If the default template parameter of "s1" is removed the code can be compiled.
Otherwise gcc produces the following output:
------------------------------------------------------
[root@unknown] /tmp# gcc template_bug.cpp
template_bug.cpp:16: ambiguous class template instantiation for `struct 
   s2<s1<int, void>, float>'
template_bug.cpp:14: candidates are: struct s2<x<t1, t2>, t3>
template_bug.cpp:10:                 struct s2<x<t1>, t2>
template_bug.cpp:16: aggregate `s2<s1<int, void>, float> y' has incomplete type 
   and cannot be defined
template_bug.cpp:16: storage size of `y' isn't known
-------------------------------------------------------
Test platforms/gcc versions:
Solaris 8/gcc 3.1.1 and 3.3.2
Mac OS X /gcc 2.95.2 and 3.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/12838] Error:"ambiguous class template instantiation" when actually there's no ambiguity
  2003-10-30  9:31 [Bug c++/12838] New: Error:"ambiguous class template instantiation" when actually there's no ambiguity peter at sanbolic dot com
@ 2003-10-30  9:36 ` pinskia at gcc dot gnu dot org
  2003-10-30 14:29 ` lerdsuwa at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-10-30  9:36 UTC (permalink / raw)
  To: gcc-bugs

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

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


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |rejects-valid
   Last reconfirmed|0000-00-00 00:00:00         |2003-10-30 09:31:12
               date|                            |


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-10-30 09:31 -------
Confirmed on the mainline (20031029), it happens since at least 2.91.66. ICC 6.0 accepts this.
I think this is an extension coming to haunt us.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/12838] Error:"ambiguous class template instantiation" when actually there's no ambiguity
  2003-10-30  9:31 [Bug c++/12838] New: Error:"ambiguous class template instantiation" when actually there's no ambiguity peter at sanbolic dot com
  2003-10-30  9:36 ` [Bug c++/12838] " pinskia at gcc dot gnu dot org
@ 2003-10-30 14:29 ` lerdsuwa at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: lerdsuwa at gcc dot gnu dot org @ 2003-10-30 14:29 UTC (permalink / raw)
  To: gcc-bugs

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

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


lerdsuwa at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE


------- Additional Comments From lerdsuwa at gcc dot gnu dot org  2003-10-30 14:10 -------
Duplicate of bug #9737.  Patch is available in case you want
the standard behavior:

  http://gcc.gnu.org/ml/gcc-patches/2003-04/msg01410.html

However, it won't be included in GCC anytime soon since the
standard in this area is changing.

*** This bug has been marked as a duplicate of 9737 ***


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-10-30 14:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-30  9:31 [Bug c++/12838] New: Error:"ambiguous class template instantiation" when actually there's no ambiguity peter at sanbolic dot com
2003-10-30  9:36 ` [Bug c++/12838] " pinskia at gcc dot gnu dot org
2003-10-30 14:29 ` lerdsuwa at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).