This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
When BOOST_PP_REPEAT macro from boost library is used, code model fails to parse the file. This macro is defined in the file <boost/preprocessor/repetition/repeat.hpp> The description of the macro is here http://www.boost.org/libs/preprocessor/doc/ref/repeat.html Below is a simplified fragment that shows the error. If you use g++ -E or cc -E, it expands to int x0 = 0 ; int x1 = 1 ; But code model fails to parse this example //-------------------------------------------------------------- //--- excerpts from boost headers #define BOOST_PP_CAT(a, b) BOOST_PP_CAT_I(a, b) #define BOOST_PP_CAT_I(a, b) a ## b // this is the only macro that has its right part replaced by just "1" // since it expands to 1 // (otherwise we have too complicated file) #define BOOST_PP_AUTO_REC(pred, n) 1 # define BOOST_PP_REPEAT_1(c, m, d) BOOST_PP_REPEAT_1_I(c, m, d) # define BOOST_PP_REPEAT_2(c, m, d) BOOST_PP_REPEAT_2_I(c, m, d) # define BOOST_PP_REPEAT_1_I(c, m, d) BOOST_PP_REPEAT_1_ ## c(m, d) # define BOOST_PP_REPEAT_2_I(c, m, d) BOOST_PP_REPEAT_2_ ## c(m, d) # define BOOST_PP_REPEAT_1_0(m, d) # define BOOST_PP_REPEAT_1_1(m, d) m(2, 0, d) # define BOOST_PP_REPEAT_1_2(m, d) BOOST_PP_REPEAT_1_1(m, d) m(2, 1, d) # define BOOST_PP_REPEAT BOOST_PP_CAT(BOOST_PP_REPEAT_, BOOST_PP_AUTO_REC(BOOST_PP_REPEAT_P, 4)) //--- below is the example of these macros usage #define DECL(z, n, text) text ## n = n; BOOST_PP_REPEAT(2, DECL, int x)
This construct is used quite frequently in boost. And often parser can not recover after this error. Upgrading to P2.
Below is simplified variant of the same problem. CC or g++ preprocessor expands it to int int a = 1; Code model fails to parse the example. #define CAT(a, b) a ## b #define FUN_1(x) int x = 1; #define MAC_A CAT(FUN_, 1) #define LAST(x) MAC_A(x) LAST(int a)
Yet even more simple example. The code below should expand to int b = 1; Model preprocessor expands it to FUN_1 ( b ) #define CAT(a, b) a ## b #define FUN_1(x) int x = 1; #define MAC_A CAT(FUN_, 1) MAC_A(b)
fixed: - fixed expanding problem - fixed concatenation/stringizing problem cvs log: Checking in APTExpandedStream.java; /shared/data/ccvs/repository/cnd/apt/src/org/netbeans/modules/cnd/apt/impl/support/APTExpandedStream.java,v <-- APTExpandedStream.java new revision: 1.1.2.7; previous revision: 1.1.2.6 done