public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "zhouzhenghui at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/55406] New: Again: pasting xxx and xxx does not give a valid preprocessing token
Date: Tue, 20 Nov 2012 01:47:00 -0000	[thread overview]
Message-ID: <bug-55406-4@http.gcc.gnu.org/bugzilla/> (raw)


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.


             reply	other threads:[~2012-11-20  1:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-20  1:47 zhouzhenghui at gmail dot com [this message]
2012-11-20  1:52 ` [Bug c/55406] " pinskia at gcc dot gnu.org
2012-11-20  2:20 ` zhouzhenghui at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-55406-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).