Opened 4 years ago

#13622 new Bugs

BOOST_SCOPE_EXIT error : use of undeclared identifier 'boost_se_params_t_*

Reported by: markus_bonk@… Owned by: Lorenzo Caminiti
Milestone: To Be Determined Component: scope_exit
Version: Boost 1.67.0 Severity: Problem
Keywords: CLang Cc:

Description

When compiling with Visual C++ 2017 LLVM-vs2017 toolset (CLang), the following code produces " error : use of undeclared identifier 'boost_se_params_t_8'"

#include <boost/scope_exit.hpp>

template <typename T>
class AClass {
public:
  int function() {
    int handle = 0;
    BOOST_SCOPE_EXIT_TPL(&handle) {
      if (handle) {
        handle = 0;
      }
    } BOOST_SCOPE_EXIT_END;
    return handle;
  }
};

class Derived : public AClass<Derived>
{
};

int main() {
  Derived d;
  return d.function();
}



>Source.cpp(8,5): error : use of undeclared identifier 'boost_se_params_t_8'
1>    BOOST_SCOPE_EXIT_TPL(&handle) {
1>    ^
1>d:\boost.org\boost_1_67_0\boost/scope_exit.hpp(902,9):  note: expanded from macro 'BOOST_SCOPE_EXIT_TPL'
1>        BOOST_SCOPE_EXIT_ID_TPL(BOOST_SCOPE_EXIT_AUX_PP_LINE_COUNTER, \
1>        ^
1>d:\boost.org\boost_1_67_0\boost/scope_exit.hpp(895,9):  note: expanded from macro 'BOOST_SCOPE_EXIT_ID_TPL'
1>        BOOST_SCOPE_EXIT_AUX_IMPL(id, typename, \
1>        ^
1>d:\boost.org\boost_1_67_0\boost/scope_exit.hpp(829,22):  note: expanded from macro 'BOOST_SCOPE_EXIT_AUX_IMPL'
1>                    (BOOST_SCOPE_EXIT_DETAIL_PARAMS_T(id)*)boost_se_params) \
1>                     ^
1>d:\boost.org\boost_1_67_0\boost/scope_exit.hpp(280,5):  note: expanded from macro 'BOOST_SCOPE_EXIT_DETAIL_PARAMS_T'
1>    BOOST_PP_CAT(boost_se_params_t_, id)
1>    ^
1>d:\boost.org\boost_1_67_0\boost/preprocessor/cat.hpp(22,32):  note: expanded from macro 'BOOST_PP_CAT'
1>#    define BOOST_PP_CAT(a, b) BOOST_PP_CAT_I(a, b)
1>                               ^
1>d:\boost.org\boost_1_67_0\boost/preprocessor/cat.hpp(29,34):  note: expanded from macro 'BOOST_PP_CAT_I'
1>#    define BOOST_PP_CAT_I(a, b) a ## b
1>                                 ^
1><scratch space>(94,1):  note: expanded from here
1>boost_se_params_t_8
1>^
1>Source.cpp(23,12):  note: in instantiation of member function 'AClass<Derived>::function' requested here
1>  return d.function();
1>           ^
1>Source.cpp(8,5): error : expected expression
1>    BOOST_SCOPE_EXIT_TPL(&handle) {
1>    ^
1>d:\boost.org\boost_1_67_0\boost/scope_exit.hpp(902,9):  note: expanded from macro 'BOOST_SCOPE_EXIT_TPL'
1>        BOOST_SCOPE_EXIT_ID_TPL(BOOST_SCOPE_EXIT_AUX_PP_LINE_COUNTER, \
1>        ^
1>d:\boost.org\boost_1_67_0\boost/scope_exit.hpp(895,9):  note: expanded from macro 'BOOST_SCOPE_EXIT_ID_TPL'
1>        BOOST_SCOPE_EXIT_AUX_IMPL(id, typename, \
1>        ^
1>d:\boost.org\boost_1_67_0\boost/scope_exit.hpp(829,59):  note: expanded from macro 'BOOST_SCOPE_EXIT_AUX_IMPL'
1>                    (BOOST_SCOPE_EXIT_DETAIL_PARAMS_T(id)*)boost_se_params) \
1>                                                          ^
1>2 errors generated.

Change History (0)

Note: See TracTickets for help on using tickets.