From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11880 invoked by alias); 3 Jan 2003 10:46:02 -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 11847 invoked by uid 71); 3 Jan 2003 10:46:00 -0000 Resent-Date: 3 Jan 2003 10:46:00 -0000 Resent-Message-ID: <20030103104600.11846.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, andrew@andypo.net Received: (qmail 7535 invoked by uid 61); 3 Jan 2003 10:36:15 -0000 Message-Id: <20030103103615.7534.qmail@sources.redhat.com> Date: Fri, 03 Jan 2003 10:46:00 -0000 From: andrew@andypo.net Reply-To: andrew@andypo.net To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/9155: [3.4 regression] new parser rejects legal use of typeid(xxx).name() X-SW-Source: 2003-01/txt/msg00183.txt.bz2 List-Id: >Number: 9155 >Category: c++ >Synopsis: [3.4 regression] new parser rejects legal use of typeid(xxx).name() >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Fri Jan 03 02:46:00 PST 2003 >Closed-Date: >Last-Modified: >Originator: Andrew Pollard >Release: gcc-3.4-20030102 >Organization: >Environment: i686-pc-linux-gnu/RedHat8.0 on a PIII >Description: The following code snippet gets an error when compiled with gcc-3.4-20030102 gcc-3.4-20021224 (pre-new parser) works... typeid.cxx: ------------------- #include struct A { virtual ~A() {} }; void foo(A* a) { typeid(*a).name(); } void bar(A* a) { const std::type_info& t = typeid(*a); t.name(); } ------------------- % g++34 typeid.cxx typeid.cxx: In function `void foo(A*)': typeid.cxx:10: error: request for member `std::type_info::name() const' in ` __cxa_bad_typeid()()', which is of non-class type `const std::type_info&' Note how 'bar(A*)' compiles fine. Is this a parser bug, or is this the standard mandated behaviour? (I'd guess a bug...) >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: