preprocessor/2884: cpp stringizing problem 2
Markus F.X.J. Oberhumer
markus@oberhumer.com
Sun May 20 11:46:00 GMT 2001
>Number: 2884
>Category: preprocessor
>Synopsis: cpp 3.0 200010426 stringizing problem 2
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Sun May 20 11:46:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Markus F.X.J. Oberhumer <markus@oberhumer.com>
>Release: 3.0 20010426 (Debian prerelease) (Debian testing/unstable)
>Organization:
none
>Environment:
System: Linux laetitia 2.4.3 #1 Wed Apr 4 03:58:32 CEST 2001 i586 unknown
Architecture: i586
=20
host: i386-pc-linux-gnu
build: i386-pc-linux-gnu
target: i386-pc-linux-gnu
configured with: ../src/configure -v
--enable-languages=3Dc,c++,java,f77,proto,objc --prefix=3D/usr
--infodir=3D/share/info --mandir=3D
/share/man --enable-shared --with-gnu-as --with-gnu-ld --with-system-zlib
--enable-long-long --enable-nls --without-x --without
-included-gettext --disable-checking --enable-threads=3Dposix
--enable-java-gc=3Dboehm --with-cpp-install-dir=3Dbin --enable-objc-gc=20
i386-linux
>Description:
cpp 3.0 200010426 stringizing problem 2
>How-To-Repeat:
$ g++-3.0 -c -Werror bug03.cxx
bug03.cxx:21:5: pasting "Foo" and "::" does not give a valid preprocessing =
token
bug03.cxx:21:5: pasting "::" and "bar" does not give a valid preprocessing =
token
----------------------------------------
$ cat bug03.cxx
/* Markus F.X.J. Oberhumer <markus@oberhumer.com>
* gcc 3.0 20010426 (Debian prerelease) bug report:
*
* cpp stringizing problem (probably related to bug02, but note
* that there are no double "" in the error message here)
*/
/* concatenate */
#define CONCAT3(a,b,c) a ## b ## c
/* expand and concatenate (by using one level of indirection) */
#define ECONCAT3(a,b,c) CONCAT3(a,b,c)
struct Foo
{
int bar(void);
};
#define C Foo
#define N(c) ECONCAT3(c,::,bar)
int N(C) (void) // Foo::bar
{
return 0;
}
>Fix:
=20
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-bugs
mailing list