public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/3638: [2003-01-02] Template class instanciated using wrong type
@ 2003-04-14  4:36 Giovanni Bajo
  0 siblings, 0 replies; 2+ messages in thread
From: Giovanni Bajo @ 2003-04-14  4:36 UTC (permalink / raw)
  To: gdr; +Cc: gcc-prs

The following reply was made to PR c++/3638; it has been noted by GNATS.

From: "Giovanni Bajo" <giovannibajo@libero.it>
To: <gcc-gnats@gcc.gnu.org>,
	<gcc-bugs@gcc.gnu.org>,
	<gdr@gcc.gnu.org>,
	<philippeb@videotron.ca>,
	<gcc-prs@gcc.gnu.org>
Cc: "Wolfgang Bangerth" <bangerth@ices.utexas.edu>,
	"Gabriel Dos Reis" <gdr@integrable-solutions.net>
Subject: Re: c++/3638: [2003-01-02] Template class instanciated using wrong type
Date: Mon, 14 Apr 2003 06:28:21 +0200

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&p
 r=3638
 
 This bug is pratically the same of c++/10394, but it shows a wrong code
 generation issue that was not noticed before:
 
 --------------------------------------------------------------
 #include <iostream>
 
 using namespace std;
 
 template <class _T> struct traits
 {
     typedef long next;
 };
 
 
 template <class _T>
 struct c1
 {
     template <class _UUU>
     struct c2
     {
         c1 c;
     };
 
     c1()
     {
         cout << __PRETTY_FUNCTION__ << endl;
     }
 
 };
 
 
 template <class _T>
 void foo()
 {
     c1<typename traits<_T>::next>::c2<void>();
     typename c1<typename traits<_T>::next>::template c2<void>();
 }
 
 
 int main()
 {
     foo<int>();
 }
 --------------------------------------------------------------
 
 When executed on 3.2/3.3, this prints:
 
 c1<_T>::c1() [with _T = int]
 c1<_T>::c1() [with _T = long int]
 
 when the type should obviously be the same. So it's a bug related to the
 implicit typename/template keywords. It's fixed in 3.4 because implicit
 typename/template are not allowed anymore, so the bug simply does not
 happen. Moreover, it's not a regression because 2.95 was giving an ICE on
 this code.
 
 I guess this should be closed, unless we consider the code generation bug
 serious enough to need a fix on the 3.3 branch.
 
 Giovanni Bajo
 


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

* Re: c++/3638: [2003-01-02] Template class instanciated using wrong type
@ 2003-04-14 13:38 bangerth
  0 siblings, 0 replies; 2+ messages in thread
From: bangerth @ 2003-04-14 13:38 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, gdr, philippeb

Synopsis: [2003-01-02] Template class instanciated using wrong type

State-Changed-From-To: analyzed->closed
State-Changed-By: bangerth
State-Changed-When: Mon Apr 14 13:38:57 2003
State-Changed-Why:
    Giovanni reports this as fixed

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=3638


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

end of thread, other threads:[~2003-04-14 13:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-14  4:36 c++/3638: [2003-01-02] Template class instanciated using wrong type Giovanni Bajo
2003-04-14 13:38 bangerth

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).