public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/9155: [3.4 regression] new parser rejects legal use of typeid(xxx).name()
@ 2003-01-03 10:46 andrew
  0 siblings, 0 replies; 2+ messages in thread
From: andrew @ 2003-01-03 10:46 UTC (permalink / raw)
  To: gcc-gnats


>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 <typeinfo>

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:


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: c++/9155: [3.4 regression] new parser rejects legal use of typeid(xxx).name()
@ 2003-01-03 16:19 paolo
  0 siblings, 0 replies; 2+ messages in thread
From: paolo @ 2003-01-03 16:19 UTC (permalink / raw)
  To: andrew, gcc-bugs, gcc-prs, nobody

Synopsis: [3.4 regression] new parser rejects legal use of typeid(xxx).name()

State-Changed-From-To: open->closed
State-Changed-By: paolo
State-Changed-When: Fri Jan  3 08:19:47 2003
State-Changed-Why:
    I'm closing it as a duplicate of c++/9128, at the same time
    marking the latter as a 3.4 regression to be sure.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9155


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-01-03 16:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-03 10:46 c++/9155: [3.4 regression] new parser rejects legal use of typeid(xxx).name() andrew
2003-01-03 16:19 paolo

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).