public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: philippeb@videotron.ca To: gcc-gnats@gcc.gnu.org Subject: c++/3638: Template class instanciated using wrong type Date: Tue, 10 Jul 2001 15:56:00 -0000 [thread overview] Message-ID: <20010710224642.11902.qmail@sourceware.cygnus.com> (raw) >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
next reply other threads:[~2001-07-10 15:56 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2001-07-10 15:56 philippeb [this message] 2001-08-12 7:05 gdr
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20010710224642.11902.qmail@sourceware.cygnus.com \ --to=philippeb@videotron.ca \ --cc=gcc-gnats@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).