public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/4241: C++ old cast parsing bug
@ 2001-09-09 14:22 aoliva
  0 siblings, 0 replies; 2+ messages in thread
From: aoliva @ 2001-09-09 14:22 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, hzoli, nobody

Synopsis: C++ old cast parsing bug

State-Changed-From-To: open->closed
State-Changed-By: aoliva
State-Changed-When: Sun Sep  9 14:22:19 2001
State-Changed-Why:
    Yup, this is the parser bug documented in the known bugs web page.  GCC attempts to parse (long (int (bh)) as if it were a prefix of a type-cast such as (long (*)(int bh)), but the attempt fails when it doesn't encounter the third closing parenthesis that would be needed for such a parse to be correct, and then it can't recover to try an alternative parsing.  The new C++ parser being written is going to solve this problem.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=4241&database=gcc


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

* c++/4241: C++ old cast parsing bug
@ 2001-09-05 14:56 Zoltan Hidvegi
  0 siblings, 0 replies; 2+ messages in thread
From: Zoltan Hidvegi @ 2001-09-05 14:56 UTC (permalink / raw)
  To: gcc-gnats

>Number:         4241
>Category:       c++
>Synopsis:       C++ old cast parsing bug
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 05 14:56:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Zoltan Hidvegi
>Release:        3.0.1 20010725 (prerelease)
>Organization:
>Environment:
System: AIX vlad 3 4 0005BA2F4C00


	
host: powerpc-ibm-aix4.3.3.0
build: powerpc-ibm-aix4.3.3.0
target: powerpc-ibm-aix4.3.3.0
configured with: ../gcc/configure --prefix=... --with-local-prefix=... --enable-languages=c,c++,java --enable-version-specific-runtime-libs --disable-nls --disable-shared
>Description:
G++ gives parse error on (long(int(bh)) + 3 < 3):

int
foo(long bh)
{
    return (long(int(bh)) + 3 < 3);
}

>How-To-Repeat:
Compile this as a C++ program:

int
foo(long bh)
{
    return (long(int(bh)) + 3 < 3);
}
>Fix:
Workaround: use ((long)int(bh) + 3 < 3)
>Release-Note:
>Audit-Trail:
>Unformatted:


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

end of thread, other threads:[~2001-09-09 14:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-09 14:22 c++/4241: C++ old cast parsing bug aoliva
  -- strict thread matches above, loose matches on Subject: below --
2001-09-05 14:56 Zoltan Hidvegi

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