Opened 10 years ago

Closed 10 years ago

#8260 closed Bugs (duplicate)

trivial code fails to compile with clang in c++11 mode

Reported by: Nathan Ridge Owned by: Frank Mori Hess
Milestone: To Be Determined Component: signals2
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:

Description

The following trivial code fails to compile with clang in C++11 mode:

#include <boost/signals2/signal.hpp>

int main()
{
    boost::signals2::signal<void()> s;
    s();
}

The compiler errors is:

In file included from test.cpp:1:
In file included from boost/signals2/signal.hpp:38:
In file included from boost/signals2/variadic_signal.hpp:21:
boost/signals2/detail/variadic_slot_invoker.hpp:92:16: error: no matching function for call to 'get'
          func(BOOST_SIGNALS2_GET<indices>(args)...);
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~
boost/signals2/detail/variadic_slot_invoker.hpp:26:28: note: expanded from macro 'BOOST_SIGNALS2_GET'
#define BOOST_SIGNALS2_GET boost::get
                           ^
boost/signals2/detail/variadic_slot_invoker.hpp:81:18: note: in instantiation of function template specialization 'boost::signals2::detail::call_with_tuple_args<boost::signals2::detail::void_type>::m_invoke<boost::function<void ()>, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type>' requested here
          return m_invoke(resolver, func, indices_type(), args);
                 ^
boost/signals2/detail/variadic_slot_invoker.hpp:117:18: note: in instantiation of function template specialization 'boost::signals2::detail::call_with_tuple_args<boost::signals2::detail::void_type>::operator()<boost::function<void ()>, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type>' requested here
          return call_with_tuple_args<result_type>()(connectionBody->slot.slot_function(), _args);
                 ^
boost/signals2/detail/variadic_slot_invoker.hpp:109:18: note: in instantiation of function template specialization 'boost::signals2::detail::variadic_slot_invoker<boost::signals2::detail::void_type, >::m_invoke<boost::shared_ptr<boost::signals2::detail::connection_body<std::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void (), boost::function<void ()> >, boost::signals2::mutex> > >' requested here
          return m_invoke(connectionBody,
                 ^
boost/signals2/detail/slot_call_iterator.hpp:82:35: note: in instantiation of function template specialization 'boost::signals2::detail::variadic_slot_invoker<boost::signals2::detail::void_type, >::operator()<boost::shared_ptr<boost::signals2::detail::connection_body<std::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void (), boost::function<void ()> >, boost::signals2::mutex> > >' requested here
              cache->result.reset(cache->f(*iter));
                                  ^
boost/iterator/iterator_facade.hpp:449:20: note: in instantiation of member function 'boost::signals2::detail::slot_call_iterator_t<boost::signals2::detail::variadic_slot_invoker<boost::signals2::detail::void_type, >, std::_List_iterator<boost::shared_ptr<boost::signals2::detail::connection_body<std::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void (), boost::function<void ()> >, boost::signals2::mutex> > >, boost::signals2::detail::connection_body<std::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void (), boost::function<void ()> >, boost::signals2::mutex> >::dereference' requested here
          return f.dereference();
                   ^
boost/iterator/iterator_facade.hpp:575:40: note: (skipping 1 context in backtrace; use -ftemplate-backtrace-limit=0 to see all)
          return iterator_core_access::dereference(this->derived());
                                       ^
boost/signals2/optional_last_value.hpp:55:13: note: in instantiation of member function 'boost::iterator_facade<boost::signals2::detail::slot_call_iterator_t<boost::signals2::detail::variadic_slot_invoker<boost::signals2::detail::void_type, >, std::_List_iterator<boost::shared_ptr<boost::signals2::detail::connection_body<std::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void (), boost::function<void ()> >, boost::signals2::mutex> > >, boost::signals2::detail::connection_body<std::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void (), boost::function<void ()> >, boost::signals2::mutex> >, boost::signals2::detail::void_type, boost::single_pass_traversal_tag, const boost::signals2::detail::void_type &, long>::operator*' requested here
            *first;
            ^
boost/signals2/detail/result_type_wrapper.hpp:64:11: note: in instantiation of function template specialization 'boost::signals2::optional_last_value<void>::operator()<boost::signals2::detail::slot_call_iterator_t<boost::signals2::detail::variadic_slot_invoker<boost::signals2::detail::void_type, >, std::_List_iterator<boost::shared_ptr<boost::signals2::detail::connection_body<std::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void (), boost::function<void ()> >, boost::signals2::mutex> > >, boost::signals2::detail::connection_body<std::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void (), boost::function<void ()> >, boost::signals2::mutex> > >' requested here
          combiner(first, last);
          ^
boost/signals2/detail/signal_template.hpp:241:18: note: in instantiation of function template specialization 'boost::signals2::detail::combiner_invoker<void>::operator()<boost::signals2::optional_last_value<void>, boost::signals2::detail::slot_call_iterator_t<boost::signals2::detail::variadic_slot_invoker<boost::signals2::detail::void_type, >, std::_List_iterator<boost::shared_ptr<boost::signals2::detail::connection_body<std::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void (), boost::function<void ()> >, boost::signals2::mutex> > >, boost::signals2::detail::connection_body<std::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void (), boost::function<void ()> >, boost::signals2::mutex> > >' requested here
          return detail::combiner_invoker<typename combiner_type::result_type>()
                 ^
boost/signals2/detail/signal_template.hpp:695:16: note: in instantiation of member function 'boost::signals2::detail::signal_impl<void (), boost::signals2::optional_last_value<void>, int, std::less<int>, boost::function<void ()>, boost::function<void (const boost::signals2::connection &)>, boost::signals2::mutex>::operator()' requested here
        return (*_pimpl)(BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS));
               ^
test.cpp:6:6: note: in instantiation of member function 'boost::signals2::signal<void (), boost::signals2::optional_last_value<void>, int, std::less<int>, boost::function<void ()>, boost::function<void (const boost::signals2::connection &)>, boost::signals2::mutex>::operator()' requested here
    s();
     ^
boost/tuple/detail/tuple_basic.hpp:211:1: note: candidate template ignored: could not match cons against tuple
get(cons<HT, TT>& c BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(int, N)) {
^
boost/tuple/detail/tuple_basic.hpp:225:1: note: candidate template ignored: could not match cons against tuple
get(const cons<HT, TT>& c BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(int, N)) {
^
boost/optional/optional.hpp:773:1: note: candidate template ignored: invalid explicitly-specified argument for template parameter 'T'
get ( optional<T> const& opt )
^
boost/optional/optional.hpp:781:1: note: candidate template ignored: invalid explicitly-specified argument for template parameter 'T'
get ( optional<T>& opt )
^
boost/optional/optional.hpp:791:1: note: candidate template ignored: invalid explicitly-specified argument for template parameter 'T'
get ( optional<T> const* opt )
^
boost/optional/optional.hpp:799:1: note: candidate template ignored: invalid explicitly-specified argument for template parameter 'T'
get ( optional<T>* opt )
^

Change History (1)

comment:1 by Frank Mori Hess, 10 years ago

Resolution: duplicate
Status: newclosed

Duplicate of #8102

Note: See TracTickets for help on using tickets.