Skip to content

Result of BOOST_PP_ARRAY_ELEM can't be included in vs2017 using /experimental:preprocessor option #25

Description

@gnaggnoyil

The following code does not compile under VS2017 using /experimental:preprocessor option:

#include<iostream>
#include<boost/preprocessor.hpp>
#defineFOO (1,(<type_traits>))
#defineBARBOOST_PP_ARRAY_ELEM(0, FOO)
#defineHOGE_1(x) x
#defineHOGE_2(x) HOGE_1(x)
#defineHOGE() HOGE_2(BAR)
#definePUYO_1(x) #x
#definePUYO_2(x) PUYO_1(x)
#definePUYO() PUYO_2(BAR)
#include BAR //C2006
#include HOGE() //C2006intmain(){
std::cout << PUYO() << std::endl;
return0;
}

Both #include BAR and #include HOGE() directives result in C2006 error, yet, PUYO macro could successfully get the string literal formed by BAR.
Switching to vs2019 eliminates this issue.

This issue breaks the usage of <boost/preprocessor/iteration/detail/iter/forward1.hpp> in `<boost/function.hpp>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions