preprocessor/10370: incorrect token parsing in preprocessor

Jens.Maurer@gmx.net Jens.Maurer@gmx.net
Thu Apr 10 16:46:00 GMT 2003


>Number:         10370
>Category:       preprocessor
>Synopsis:       incorrect token parsing in preprocessor
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Apr 10 16:46:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Jens Maurer
>Release:        gcc version 3.2
>Organization:
>Environment:
Linux x86
>Description:
I believe the preprocessor is incorrect when substituting
in MACRO below.  In particular, reading the grammar in
the C++ standard, I think that 2_abc should be parsed as
two preprocessor tokens, and thus should come out
as two tokens.

(I'm using the C++ compiler in case that matters.)
>How-To-Repeat:
struct z2_abc { };

#define MACRO(X)  X ## 2_abc

MACRO(z) var;       // should expand to z2 _abc  because of token rules
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
 



More information about the Gcc-prs mailing list