[llvm-bugs] [Bug 24372] New: clang fails to compile "future" from gcc 5.1

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Aug 6 01:26:56 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=24372

            Bug ID: 24372
           Summary: clang fails to compile "future" from gcc 5.1
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: yaron.keren at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

> cat as.cpp
#include <future>
int main() {}

> gcc -v
...
gcc version 5.1.0 (i686-posix-dwarf-rev0, Built by MinGW-W64 project)

> g++ -std=c++11 -c as.cpp

> clang -v
zapcc clang version 3.8.0 (trunk 243996) (based on LLVM 3.8.0svn) built on Aug 
4 2015 20:23:43

> clang++ -std=c++11 -c as.cpp

In file included from as.cpp:1:
In file included from C:\mingw32\i686-w64-mingw32\include\c++\future:38:
C:\mingw32\i686-w64-mingw32\include\c++\functional:1426:7: error: static_assert
failed "Wrong number of arguments for pointer-to-member"

      static_assert(_Varargs::value
      ^             ~~~~~~~~~~~~~~~
C:\mingw32\i686-w64-mingw32\include\c++\functional:1539:7: note: in
instantiation of template class 'std::_Bind_check_arity<void
     
(std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base,
      std::__future_base::_Result_base::_Deleter> ()> *, bool *)
__attribute__((thiscall)), std::__future_base::_State_baseV2 *,
      std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()> *, bool *>'
      requested here
    : _Bind_check_arity<typename decay<_Func>::type, _BoundArgs...>
      ^
C:\mingw32\i686-w64-mingw32\include\c++\functional:1551:14: note: in
instantiation of template class 'std::_Bind_simple_helper<void
     
(std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base,
      std::__future_base::_Result_base::_Deleter> ()> *, bool *)
__attribute__((thiscall)), std::__future_base::_State_baseV2 *,
      std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()> *, bool *>'
      requested here
    typename _Bind_simple_helper<_Callable, _Args...>::__type
             ^
C:\mingw32\i686-w64-mingw32\include\c++\mutex:717:30: note: while substituting
deduced template arguments into function template
      '__bind_simple' [with _Callable = void
     
(std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base,
      std::__future_base::_Result_base::_Deleter> ()> *, bool *)
__attribute__((thiscall)), _Args = <std::__future_base::_State_baseV2
      *, std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()> *, bool *>]
      auto __bound_functor = std::__bind_simple(std::forward<_Callable>(__f),
                             ^
C:\mingw32\i686-w64-mingw32\include\c++\future:386:2: note: in instantiation of
function template specialization 'std::call_once<void
     
(std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base,
      std::__future_base::_Result_base::_Deleter> ()> *, bool *)
__attribute__((thiscall)), std::__future_base::_State_baseV2 *,
      std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()> *, bool *>'
      requested here
        call_once(_M_once, &_State_baseV2::_M_do_set, this,
        ^
In file included from as.cpp:1:
In file included from C:\mingw32\i686-w64-mingw32\include\c++\future:39:
C:\mingw32\i686-w64-mingw32\include\c++\mutex:717:30: error: no matching
function for call to '__bind_simple'
      auto __bound_functor = std::__bind_simple(std::forward<_Callable>(__f),
                             ^~~~~~~~~~~~~~~~~~
C:\mingw32\i686-w64-mingw32\include\c++\future:386:2: note: in instantiation of
function template specialization 'std::call_once<void
     
(std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base,
      std::__future_base::_Result_base::_Deleter> ()> *, bool *)
__attribute__((thiscall)), std::__future_base::_State_baseV2 *,
      std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()> *, bool *>'
      requested here
        call_once(_M_once, &_State_baseV2::_M_do_set, this,
        ^
C:\mingw32\i686-w64-mingw32\include\c++\functional:1552:5: note: candidate
template ignored: substitution failure [with _Callable = void

     
(std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base,
      std::__future_base::_Result_base::_Deleter> ()> *, bool *)
__attribute__((thiscall)), _Args = <std::__future_base::_State_baseV2
      *, std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()> *, bool *>]
    __bind_simple(_Callable&& __callable, _Args&&... __args)
    ^
C:\mingw32\i686-w64-mingw32\include\c++\functional:680:24: error: reference to
non-static member function must be called; did you mean
      to call it with no arguments?
      { return __object.*_M_pm; }
               ~~~~~~~~^~~~~~~
C:\mingw32\i686-w64-mingw32\include\c++\functional:717:11: note: in
instantiation of member function 'std::_Mem_fn_base<void
      (std::thread::*)() __attribute__((thiscall)), false>::operator()'
requested here
        { return (*this)(__ref.get()); }
                 ^
C:\mingw32\i686-w64-mingw32\include\c++\functional:1530:18: note: in
instantiation of function template specialization
      'std::_Mem_fn_base<void (std::thread::*)() __attribute__((thiscall)),
false>::operator()<std::thread, void>' requested here
          return std::forward<_Callable>(std::get<0>(_M_bound))(
                 ^
C:\mingw32\i686-w64-mingw32\include\c++\functional:1520:16: note: in
instantiation of function template specialization
      'std::_Bind_simple<std::_Mem_fn<void (std::thread::*)()
__attribute__((thiscall))>
      (std::reference_wrapper<std::thread>)>::_M_invoke<0>' requested here
        return _M_invoke(_Indices());
               ^
C:\mingw32\i686-w64-mingw32\include\c++\mutex:697:7: note: in instantiation of
member function 'std::_Bind_simple<std::_Mem_fn<void
      (std::thread::*)() __attribute__((thiscall))>
(std::reference_wrapper<std::thread>)>::operator()' requested here
      (*(_Callable*)__once_callable)();
      ^
C:\mingw32\i686-w64-mingw32\include\c++\mutex:720:22: note: in instantiation of
function template specialization
      'std::__once_call_impl<std::_Bind_simple<std::_Mem_fn<void
(std::thread::*)() __attribute__((thiscall))>
      (std::reference_wrapper<std::thread>)> >' requested here
      __once_call = &__once_call_impl<decltype(__bound_functor)>;
                     ^
C:\mingw32\i686-w64-mingw32\include\c++\future:1638:27: note: in instantiation
of function template specialization 'std::call_once<void
      (std::thread::*)() __attribute__((thiscall)),
std::reference_wrapper<std::thread> >' requested here
    void _M_join() { std::call_once(_M_once, &thread::join, ref(_M_thread)); }
                          ^
In file included from as.cpp:1:
In file included from C:\mingw32\i686-w64-mingw32\include\c++\future:38:
C:\mingw32\i686-w64-mingw32\include\c++\functional:680:16: error: non-const
lvalue reference to type 'void () __attribute__((thiscall))'

      cannot bind to a temporary of type 'void'
      { return __object.*_M_pm; }
               ^~~~~~~~~~~~~~~
4 errors generated.



-std=gnu++11 or -std=gnu++14 did not help.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150806/b681f93a/attachment.html>


More information about the llvm-bugs mailing list