public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/3638: Template class instanciated using wrong type
@ 2001-08-12  7:05 gdr
  0 siblings, 0 replies; 2+ messages in thread
From: gdr @ 2001-08-12  7:05 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, gdr, nobody, philippeb

Synopsis: Template class instanciated using wrong type

Responsible-Changed-From-To: unassigned->gdr
Responsible-Changed-By: gdr
Responsible-Changed-When: Sun Aug 12 07:05:07 2001
Responsible-Changed-Why:
    \x13See below.
State-Changed-From-To: open->analyzed
State-Changed-By: gdr
State-Changed-When: Sun Aug 12 07:05:07 2001
State-Changed-Why:
    Confirmed as a bug.  GCC-3.1 is even worse: It compile the program
    to print the following:
      void foo() [with _T = int]
      c1<_T>::c1() [with _T = int]
      c1<_T>::c1() [with _T = int]
      c1<_T>::c1() [with _T = long int]
      c1<_T>::c1() [with _T = long int]
    
    Which means GCC currently is being creating an object of the
    wrong type somewhere.
    
    -- Gaby
     

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


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

* c++/3638: Template class instanciated using wrong type
@ 2001-07-10 15:56 philippeb
  0 siblings, 0 replies; 2+ messages in thread
From: philippeb @ 2001-07-10 15:56 UTC (permalink / raw)
  To: gcc-gnats

>Number:         3638
>Category:       c++
>Synopsis:       Template class instanciated using wrong type
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 10 15:56:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     g++ 3.0
>Release:        20010402 (Debian prerelease)
>Organization:
>Environment:
Debian i386
>Description:
The compiler is generating a nested template class using the wrong type. The attached program generates the following output:
1) void foo() [with _T = int]
2) c1<_T>::c1() [with _T = int]
3) c1<_T>::c1() [with _T = long int]

The second line should be the same as the 3rd line. I think the 'typename' keyword is problematic.
>How-To-Repeat:

>Fix:
Find a way not to use the 'typename' keyword.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-c++src; name="recursivetemplate.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="recursivetemplate.cpp"

I2luY2x1ZGUgPGlvc3RyZWFtPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCnRlbXBsYXRlIDxjbGFz
cyBfVD4gc3RydWN0IHRyYWl0cwp7Cgl0eXBlZGVmIGxvbmcgbmV4dDsKfTsKCgp0ZW1wbGF0ZSA8
Y2xhc3MgX1Q+CglzdHJ1Y3QgYzEKCXsKCQljMSgpCgkJewoJCQljb3V0IDw8IF9fUFJFVFRZX0ZV
TkNUSU9OX18gPDwgZW5kbDsKCQl9CgoJCXRlbXBsYXRlIDxjbGFzcyBfVT4KCQkJc3RydWN0IGMy
CgkJCXsKCQkJCWMxIGM7CgkJCX07Cgl9OwoKCnRlbXBsYXRlIDxjbGFzcyBfVD4KCXZvaWQgZm9v
KCkKCXsKCQljb3V0IDw8IF9fUFJFVFRZX0ZVTkNUSU9OX18gPDwgZW5kbDsKCQljMTx0eXBlbmFt
ZSB0cmFpdHM8X1Q+OjpuZXh0Pjo6YzI8dm9pZD4oKTsKCX0KCgppbnQgbWFpbigpCnsKCWZvbzxp
bnQ+KCk7CgljMTx0cmFpdHM8aW50Pjo6bmV4dD46OmMyPHZvaWQ+KCk7Cn0K


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

end of thread, other threads:[~2001-08-12  7:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-12  7:05 c++/3638: Template class instanciated using wrong type gdr
  -- strict thread matches above, loose matches on Subject: below --
2001-07-10 15:56 philippeb

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