This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/14789] New: Preprocessor broken
- From: "s_gccbugzilla at nedprod dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Mar 2004 23:43:54 -0000
- Subject: [Bug c++/14789] New: Preprocessor broken
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
A very interesting bug this - I have found it in both v3.2.2 and v3.4 CVS
20040324:
Test source:
/* Test for GCC v3.4 preprocessor bug
by Niall Douglas
*/
class FXApp;
template<class type> class iterator_range;
#define DEFINE_MAKECARRAYITER(contType, memberType, getArrayFunction,
getArrayFunctionPars, getArrayLengthFunction) \
static iterator_range<memberType *>
##contType##_##getArrayFunction##(contType &c)
DEFINE_MAKECARRAYITER(FXApp, const char *, getArgv, (), c.getArgc())
int main(void)
{
}
Trying to compile this valid code causes an error. Listing CVS output:
[ned@katey Python]$ g++ -c -E preprocbug.cpp
# 1 "preprocbug.cpp"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "preprocbug.cpp"
class FXApp;
template<class type> class iterator_range;
preprocbug.cpp:11:1: pasting ">" and "FXApp" does not give a valid preprocessing
token
preprocbug.cpp:11:1: pasting "FXApp_getArgv" and "(" does not give a valid
preprocessing token
static iterator_range<const char * *>FXApp_getArgv(FXApp &c)
int main(void)
{
}
[ned@katey Python]$ gcc --version
gcc (GCC) 3.4.0 20040324 (prerelease)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
As you can see, it's forgetting to put a space in before the token insert. I'd
imagine this is a very easy bug to fix for someone familiar with the code
Cheers,
Niall
--
Summary: Preprocessor broken
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: s_gccbugzilla at nedprod dot com
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14789