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: unassig...@gcc.gnu.org

        ReportedBy: zhouzheng...@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 via email to