[Bug c++/66841] [concepts] bogus error "invalid reference to function concept" when function concept is overloaded

andrew.n.sutton at gmail dot com gcc-bugzilla@gcc.gnu.org
Sun Jul 12 20:40:00 GMT 2015


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

--- Comment #1 from Andrew Sutton <andrew.n.sutton at gmail dot com> ---
The program is ill-formed. In this line:

   requires Constructible<T, Args...>() // ERROR HERE

There's no single declaration of Constructible that can be matched to those
template arguments. You would need one with this signature: <typename T,
typename... Args>.

I think defining Constructible so that it backends into a type trait will give
you the behavior you're looking for.

template<typename T, typename... Args>
concept bool Constructible() {
  return std::is_constructible<T, Args...>::value;
}



More information about the Gcc-bugs mailing list