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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
   Last reconfirmed|2017-10-01 00:00:00         |2018-5-3
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=80916

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
A smaller testcase:

template<typename T> struct trait { static constexpr bool value = false; };

struct thread {
  template<typename T, typename... U>
    thread(T t)
    {
      static_assert(trait<T>::value, "trait");

      foo(t);
    }

  template<typename T> void foo(T) { return; }
};

int main()
{
  thread t([](int) { });
}


used.cc: In instantiation of 'thread::thread(T) [with T =
main()::<lambda(int)>; U = {}]':
used.cc:17:23:   required from here
used.cc:7:21: error: static assertion failed: trait
       static_assert(trait<T>::value, "trait");
                     ^~~~~~~~
used.cc:12:29: error: 'void thread::foo(T) [with T = main()::<lambda(int)>]',
declared using local type 'main()::<lambda(int)>', is used but never defined
[-fpermissive]
   template<typename T> void foo(T) { return; }
                             ^~~
used.cc:12:29: warning: 'void thread::foo(T) [with T = main()::<lambda(int)>]'
used but never defined

Reply via email to