From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8507 invoked by alias); 16 Dec 2003 00:03:44 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 8485 invoked by uid 48); 16 Dec 2003 00:03:43 -0000 Date: Tue, 16 Dec 2003 00:03:00 -0000 From: "austern at apple dot com" To: gcc-bugs@gcc.gnu.org Message-ID: <20031216000332.13407.austern@apple.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/13407] New: Confusing error message from extraneous typename X-Bugzilla-Reason: CC X-SW-Source: 2003-12/txt/msg01586.txt.bz2 List-Id: Consider the following code sample: struct A { }; struct B { typedef A Type; }; template struct X : public typename T::Type { }; X x; The mainline compiler gives the following error messages: bc.cc:5: error: expected class-name bc.cc:5: error: expected `{' bc.cc:6: error: expected unqualified-id bc.cc:6: error: expected `;' ... An error message is appropriate, since the code really is wrong. However, a naive user (even a sophisticated user!) would be hard pressed to figure out the real reason for this cascade of errors: 'typename' is forbidden in a base-specifier. This is a regression from 3.3. The 3.3 error messages were pretty bad too, but at least they gave a hint that the problem had something to do with 'typename'. -- Summary: Confusing error message from extraneous typename Product: gcc Version: 3.4 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: austern at apple dot com CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13407