c++/4241: C++ old cast parsing bug

Zoltan Hidvegi hzoli@austin.ibm.com
Wed Sep 5 14:56:00 GMT 2001


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



More information about the Gcc-bugs mailing list