Boost logo

Boost :

Subject: Re: [boost] [test] A new ERROR in trunk including C++11 features on C++98 mode
From: Antony Polukhin (antoshkka_at_[hidden])
Date: 2012-11-10 02:14:57


2012/11/10 Vicente J. Botet Escriba <vicente.botet_at_[hidden]>:
> Le 10/11/12 01:48, Vicente J. Botet Escriba a écrit :
>
>> Le 10/11/12 00:43, Vicente J. Botet Escriba a écrit :
>>>
>>> Le 09/11/12 19:58, Gennadiy Rozental a écrit :
>>>>
>>>> Vicente J. Botet Escriba <vicente.botet <at> wanadoo.fr> writes:
>>>>>
>>>>> there are yet new warnings.
>>>>
>>>> I'll fix these tonight

One more error (can be reproduced on clang-3.0, works on GCC) during
compilation of following code:

template <class To, class From, class Func>
To try_cast_by_ptr(const From& from, Func f) {
    return f(from);
};

void test_getting_pointer_to_function()
{
    // Just checking that &lexical_cast<To, From> is not ambiguous
    BOOST_CHECK_EQUAL(100, try_cast_by_ptr<int>("100",
&boost::lexical_cast<int, const char[4]>));
    BOOST_CHECK_EQUAL(100, try_cast_by_ptr<int>("100",
&boost::lexical_cast<int, std::string>));
    BOOST_CHECK_EQUAL(std::string("100"),
try_cast_by_ptr<std::string>(100, &boost::lexical_cast<std::string,
int>));
}

Error text:

../lexical_cast_test.cpp:618:28: error: no matching function for call
to 'try_cast_by_ptr'
    BOOST_CHECK_EQUAL(100, try_cast_by_ptr<int>("100",
&boost::lexical_cast<int, const char[4]>));
    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../boost/test/test_tools.hpp:230:84: note: expanded from:
    ::boost::test_tools::tt_detail::equal_impl_frwd(), "", CHECK,
CHECK_EQUAL, (L)(R), BOOST_PP_EMPTY() )

            ^
../../../boost/test/test_tools.hpp:88:61: note: expanded from:
        BOOST_JOIN( BOOST_TEST_TOOL_PASS_ARGS, frwd_type )( ARGS ) );
         \
                                                            ^
../../../boost/test/test_tools.hpp:70:57: note: expanded from:
    BOOST_PP_SEQ_FOR_EACH( BOOST_TEST_TOOL_PASS_ARG, _, ARGS )
                                                        ^
note: (skipping 16 expansions in backtrace; use
-fmacro-backtrace-limit=0 to see all)
../../../boost/preprocessor/seq/elem.hpp:43:60: note: expanded from:
# define BOOST_PP_SEQ_ELEM_II(im) BOOST_PP_SEQ_ELEM_III(im)
                                                           ^
../../../boost/preprocessor/seq/elem.hpp:44:41: note: expanded from:
# define BOOST_PP_SEQ_ELEM_III(x, _) x
                                        ^
../../../boost/test/test_tools.hpp:66:49: note: expanded from:
#define BOOST_TEST_TOOL_PASS_ARG( r, _, arg ) , arg, BOOST_STRINGIZE( arg )
                                                ^~~
../lexical_cast_test.cpp:611:4: note: candidate template ignored:
couldn't infer template argument 'Func'
To try_cast_by_ptr(const From& from, Func f) {
   ^
../lexical_cast_test.cpp:619:28: error: no matching function for call
to 'try_cast_by_ptr'
    BOOST_CHECK_EQUAL(100, try_cast_by_ptr<int>("100",
&boost::lexical_cast<int, std::string>));
    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../boost/test/test_tools.hpp:230:84: note: expanded from:
    ::boost::test_tools::tt_detail::equal_impl_frwd(), "", CHECK,
CHECK_EQUAL, (L)(R), BOOST_PP_EMPTY() )

            ^
../../../boost/test/test_tools.hpp:88:61: note: expanded from:
        BOOST_JOIN( BOOST_TEST_TOOL_PASS_ARGS, frwd_type )( ARGS ) );
         \
                                                            ^
../../../boost/test/test_tools.hpp:70:57: note: expanded from:
    BOOST_PP_SEQ_FOR_EACH( BOOST_TEST_TOOL_PASS_ARG, _, ARGS )
                                                        ^
note: (skipping 16 expansions in backtrace; use
-fmacro-backtrace-limit=0 to see all)
../../../boost/preprocessor/seq/elem.hpp:43:60: note: expanded from:
# define BOOST_PP_SEQ_ELEM_II(im) BOOST_PP_SEQ_ELEM_III(im)
                                                           ^
../../../boost/preprocessor/seq/elem.hpp:44:41: note: expanded from:
# define BOOST_PP_SEQ_ELEM_III(x, _) x
                                        ^
../../../boost/test/test_tools.hpp:66:49: note: expanded from:
#define BOOST_TEST_TOOL_PASS_ARG( r, _, arg ) , arg, BOOST_STRINGIZE( arg )
                                                ^~~
../lexical_cast_test.cpp:611:4: note: candidate template ignored:
couldn't infer template argument 'Func'
To try_cast_by_ptr(const From& from, Func f) {
   ^
../lexical_cast_test.cpp:620:43: error: no matching function for call
to 'try_cast_by_ptr'
    BOOST_CHECK_EQUAL(std::string("100"),
try_cast_by_ptr<std::string>(100, &boost::lexical_cast<std::string,
int>));
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../boost/test/test_tools.hpp:230:84: note: expanded from:
    ::boost::test_tools::tt_detail::equal_impl_frwd(), "", CHECK,
CHECK_EQUAL, (L)(R), BOOST_PP_EMPTY() )

            ^
../../../boost/test/test_tools.hpp:88:61: note: expanded from:
        BOOST_JOIN( BOOST_TEST_TOOL_PASS_ARGS, frwd_type )( ARGS ) );
         \
                                                            ^
../../../boost/test/test_tools.hpp:70:57: note: expanded from:
    BOOST_PP_SEQ_FOR_EACH( BOOST_TEST_TOOL_PASS_ARG, _, ARGS )
                                                        ^
note: (skipping 16 expansions in backtrace; use
-fmacro-backtrace-limit=0 to see all)
../../../boost/preprocessor/seq/elem.hpp:43:60: note: expanded from:
# define BOOST_PP_SEQ_ELEM_II(im) BOOST_PP_SEQ_ELEM_III(im)
                                                           ^
../../../boost/preprocessor/seq/elem.hpp:44:41: note: expanded from:
# define BOOST_PP_SEQ_ELEM_III(x, _) x
                                        ^
../../../boost/test/test_tools.hpp:66:49: note: expanded from:
#define BOOST_TEST_TOOL_PASS_ARG( r, _, arg ) , arg, BOOST_STRINGIZE( arg )
                                                ^~~
../lexical_cast_test.cpp:611:4: note: candidate template ignored:
couldn't infer template argument 'Func'
To try_cast_by_ptr(const From& from, Func f) {
   ^
3 errors generated.

--
Best regards,
Antony Polukhin

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk