[Bug libstdc++/80690] New: [7/8 Regression] clang rejects std::thread with -std=c++1z

trippels at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue May 9 10:27:00 GMT 2017


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

            Bug ID: 80690
           Summary: [7/8 Regression] clang rejects std::thread with
                    -std=c++1z
           Product: gcc
           Version: 7.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: trippels at gcc dot gnu.org
  Target Milestone: ---

markus@x4 /tmp % cat thread.cpp
#include <thread>
static void f() {}
int main() { std::thread t(f); }

markus@x4 /tmp % g++ -std=gnu++1z -pthread thread.cpp
markus@x4 /tmp % clang++ -std=c++14 -pthread thread.cpp
markus@x4 /tmp % clang++ -std=c++1z -pthread thread.cpp
In file included from thread.cpp:1:
In file included from
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include/g++-v7/thread:39:
In file included from
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include/g++-v7/memory:80:
In file included from
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include/g++-v7/bits/unique_ptr.h:37:
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include/g++-v7/tuple:165:13: error: data
member instantiated with function type 'void ()'
      _Head _M_head_impl;
            ^
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include/g++-v7/tuple:344:15: note: in
instantiation of template class 'std::_Head_base<0, void (), false>' requested
here
    : private _Head_base<_Idx, _Head>
              ^
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include/g++-v7/tuple:556:26: note: in
instantiation of template class 'std::_Tuple_impl<0, void ()>' requested here
    class tuple : public _Tuple_impl<0, _Elements...>
                         ^
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include/g++-v7/thread:223:9: note: in
instantiation of template class 'std::tuple<void ()>' requested here
        _Tuple _M_t;
               ^
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include/g++-v7/thread:127:8: note: in
instantiation of template class 'std::thread::_Invoker<std::tuple<void ()> >'
requested here
              __make_invoker(std::forward<_Callable>(__f),
              ^
thread.cpp:3:26: note: in instantiation of function template specialization
'std::thread::thread<void (&)()>' requested here
int main() { std::thread t(f); }
                         ^
In file included from thread.cpp:1:
In file included from
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include/g++-v7/thread:39:
In file included from
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include/g++-v7/memory:80:
In file included from
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include/g++-v7/bits/unique_ptr.h:37:
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include/g++-v7/tuple:1452:14: error: no
matching conversion for functional-style cast from 'void ()' to '__result_type'
      (aka 'tuple<void ()>')
      return __result_type(std::forward<_Elements>(__args)...);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include/g++-v7/thread:259:11: note: in
instantiation of function template specialization 'std::make_tuple<void (&)()>'
requested here
            std::make_tuple(std::forward<_Callable>(__callable),
                 ^
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include/g++-v7/thread:127:8: note: in
instantiation of function template specialization
'std::thread::__make_invoker<void (&)()>' requested
      here
              __make_invoker(std::forward<_Callable>(__f),
              ^
thread.cpp:3:26: note: in instantiation of function template specialization
'std::thread::thread<void (&)()>' requested here
int main() { std::thread t(f); }
                         ^
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include/g++-v7/tuple:660:17: note:
candidate constructor not viable: no known conversion from 'void ()' to 'const
std::tuple<void ()>' for
      1st argument
      constexpr tuple(const tuple&) = default;
                ^
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include/g++-v7/tuple:662:17: note:
candidate constructor not viable: no known conversion from 'void ()' to
'std::tuple<void ()>' for 1st
      argument
      constexpr tuple(tuple&&) = default;
                ^
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include/g++-v7/tuple:602:18: note:
candidate template ignored: disabled by 'enable_if' [with _Dummy = void]
                 _TCC<_Dummy>::template
                 ^
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include/g++-v7/tuple:613:18: note:
candidate template ignored: disabled by 'enable_if' [with _Dummy = void]
                 _TCC<_Dummy>::template
                 ^
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include/g++-v7/tuple:640:5: note:
candidate template ignored: disabled by 'enable_if' [with _UElements = <void
(&)()>]
                  _TMC<_UElements...>::template
                  ^
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include/g++-v7/tuple:651:5: note:
candidate template ignored: disabled by 'enable_if' [with _UElements = <void
(&)()>]
                  _TMC<_UElements...>::template
                  ^
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include/g++-v7/tuple:678:19: note:
candidate template ignored: could not match 'tuple<type-parameter-0-0...>'
against 'void ()'
        constexpr tuple(const tuple<_UElements...>& __in)
                  ^
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include/g++-v7/tuple:690:28: note:
candidate template ignored: could not match 'tuple<type-parameter-0-0...>'
against 'void ()'
        explicit constexpr tuple(const tuple<_UElements...>& __in)
                           ^
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include/g++-v7/tuple:702:19: note:
candidate template ignored: could not match 'tuple<type-parameter-0-0...>'
against 'void ()'
        constexpr tuple(tuple<_UElements...>&& __in)
                  ^
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include/g++-v7/tuple:713:28: note:
candidate template ignored: could not match 'tuple<type-parameter-0-0...>'
against 'void ()'
        explicit constexpr tuple(tuple<_UElements...>&& __in)
                           ^
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include/g++-v7/tuple:719:2: note:
candidate constructor template not viable: requires 2 arguments, but 1 was
provided
        tuple(allocator_arg_t __tag, const _Alloc& __a)
        ^
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include/g++-v7/tuple:729:2: note:
candidate constructor template not viable: requires 3 arguments, but 1 was
provided
        tuple(allocator_arg_t __tag, const _Alloc& __a,
        ^
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include/g++-v7/tuple:740:11: note:
candidate constructor template not viable: requires 3 arguments, but 1 was
provided
        explicit tuple(allocator_arg_t __tag, const _Alloc& __a,
                 ^
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include/g++-v7/tuple:750:2: note:
candidate constructor template not viable: requires at least 2 arguments, but 1
was provided
        tuple(allocator_arg_t __tag, const _Alloc& __a,
        ^
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include/g++-v7/tuple:761:11: note:
candidate constructor template not viable: requires at least 2 arguments, but 1
was provided
        explicit tuple(allocator_arg_t __tag, const _Alloc& __a,
                 ^
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include/g++-v7/tuple:767:2: note:
candidate constructor template not viable: requires 3 arguments, but 1 was
provided
        tuple(allocator_arg_t __tag, const _Alloc& __a, const tuple& __in)
        ^
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include/g++-v7/tuple:771:2: note:
candidate constructor template not viable: requires 3 arguments, but 1 was
provided
        tuple(allocator_arg_t __tag, const _Alloc& __a, tuple&& __in)
        ^
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include/g++-v7/tuple:783:2: note:
candidate constructor template not viable: requires 3 arguments, but 1 was
provided
        tuple(allocator_arg_t __tag, const _Alloc& __a,
        ^
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include/g++-v7/tuple:798:11: note:
candidate constructor template not viable: requires 3 arguments, but 1 was
provided
        explicit tuple(allocator_arg_t __tag, const _Alloc& __a,
                 ^
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include/g++-v7/tuple:813:2: note:
candidate constructor template not viable: requires 3 arguments, but 1 was
provided
        tuple(allocator_arg_t __tag, const _Alloc& __a,
        ^
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include/g++-v7/tuple:581:17: note:
candidate constructor template not viable: requires 0 arguments, but 1 was
provided
      constexpr tuple()
                ^
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include/g++-v7/tuple:828:11: note:
candidate constructor template not viable: requires 3 arguments, but 1 was
provided
        explicit tuple(allocator_arg_t __tag, const _Alloc& __a,
                 ^
/usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include/g++-v7/tuple:591:26: note:
candidate constructor template not viable: requires 0 arguments, but 1 was
provided
      explicit constexpr tuple()
                         ^
2 errors generated.


More information about the Gcc-bugs mailing list