https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69060

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Sławomir from comment #1)
> The same with version 4.9.4 20150813 (prerelease)

No, the error for your (incomplete, and so not very useful) example is not the
same at all.

> Error:
>   CXX     diag/bin/fsmf_test/collector_handler.o
> src/log_collecting/collector_handler.cpp: In member function ‘void
> diag::collector_handler::add_file_to_dl_list(const string&, bool)’:
> src/log_collecting/collector_handler.cpp:274:47: error: cannot bind ‘bool’
> lvalue to ‘bool&&’
>   observers_list->notify_observers(uri, is_last);
>                                                ^

This error is correct, because 'is_last' is an lvalue, but ...

> In file included from ../diag/src/log_collecting/diag_object.h:8:0,
>                  from src/log_collecting/collector_handler.h:11,
>                  from src/log_collecting/collector_handler.cpp:13:
> ../diag/src/log_collecting/observers_container.h:52:15: note: initializing
> argument 2 of ‘void
> diag::observers_container<callback_args_types>::
> notify_observers(callback_args_types&& ...) [with callback_args_types =
> {boost::optional<std::basic_string<char, std::char_traits<char>,
> std::allocator<char> > >, bool}]’
>   virtual void notify_observers(callback_args_types&&... args) {

This function only accepts rvalues.

Reply via email to