From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9882 invoked by alias); 22 Apr 2003 01:16:00 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 9855 invoked by uid 71); 22 Apr 2003 01:16:00 -0000 Resent-Date: 22 Apr 2003 01:16:00 -0000 Resent-Message-ID: <20030422011600.9854.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, giovannibajo@libero.it Received: (qmail 7967 invoked by uid 48); 22 Apr 2003 01:09:44 -0000 Message-Id: <20030422010944.7966.qmail@sources.redhat.com> Date: Tue, 22 Apr 2003 01:16:00 -0000 From: giovannibajo@libero.it Reply-To: giovannibajo@libero.it To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/10449: Totally bogus error message on missing typename (GCC 3.4) X-SW-Source: 2003-04/txt/msg00915.txt.bz2 List-Id: >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 struct Identity { typedef T type; }; struct Bar { template typename Identity::type func(T t) { return Identity::type(t); } }; int main() { Bar b; b.func(Foo()); } ------------------------------ gcc34bug1.cpp: In member function `typename Identity::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: