This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/55406] New: Again: pasting xxx and xxx does not give a valid preprocessing token
- From: "zhouzhenghui at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 20 Nov 2012 01:47:39 +0000
- Subject: [Bug c/55406] New: Again: pasting xxx and xxx does not give a valid preprocessing token
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55406
Bug #: 55406
Summary: Again: pasting xxx and xxx does not give a valid
preprocessing token
Classification: Unclassified
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: c
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: zhouzhenghui@gmail.com
I have konwn that there are too many "SPAM" about this title. Most of them are
list in BUG [7976], http://gcc.gnu.org/bugzilla/show_bug.cgi?id=7976. The
compiler requirement of a valid preprocessing token is correct due to the
standard definition.
But when taking the the preprocessor as a meta programming language, there is
chance to running into such situation. One thing is the BOOST_PP_IS_EMPTY
assertion. The example may be:
#include <boost/preprocessor/facilities/is_empty.hpp>
BOOST_PP_IS_EMPTY() /* result: 1 */
BOOST_PP_IS_EMPTY(a) /* result: 0 */
BOOST_PP_IS_EMPTY(+a) /* error report here, for '+' cannot be pasted */
And more information I have posted to comp.std.c, take a look at
https://groups.google.com/forum/?fromgroups=#!topic/comp.std.c/7rgt8k6ILMM.
Since in most simple cases, the cocmpiler just does the same thing of pasting
when omitting the ## operator, so may be it is a option to allow pasting tokens
here.