public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: giovannibajo@libero.it To: gcc-gnats@gcc.gnu.org Subject: c++/10449: Totally bogus error message on missing typename (GCC 3.4) Date: Tue, 22 Apr 2003 01:16:00 -0000 [thread overview] Message-ID: <20030422010944.7966.qmail@sources.redhat.com> (raw) >Number: 10449 >Category: c++ >Synopsis: Totally bogus error message on missing typename (GCC 3.4) >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: change-request >Submitter-Id: net >Arrival-Date: Tue Apr 22 01:16:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Giovanni Bajo >Release: g++-3.4 (GCC) 3.4 20030413 (experimental) >Organization: >Environment: cygwin >Description: The following legal code gives a totally bogus error message on mainline: ------------------------------ struct Foo {}; template <typename T> struct Identity { typedef T type; }; struct Bar { template <typename T> typename Identity<T>::type func(T t) { return Identity<T>::type(t); } }; int main() { Bar b; b.func(Foo()); } ------------------------------ gcc34bug1.cpp: In member function `typename Identity<T>::type Bar::func(T) [with T = Foo]': gcc34bug1.cpp:24: instantiated from here gcc34bug1.cpp:16: error: no match for call to `(Foo) (Foo&)' The problem in the above code is that line 16 is missing the typename keyword. This is obviously not reproducible on 3.3 or previous due to the implicit typename extensions. >How-To-Repeat: Compile the above file on 3.4 >Fix: >Release-Note: >Audit-Trail: >Unformatted:
reply other threads:[~2003-04-22 1:16 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20030422010944.7966.qmail@sources.redhat.com \ --to=giovannibajo@libero.it \ --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).