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

2015-08-04 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66841

Jason Merrill jason at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #3 from Jason Merrill jason at gcc dot gnu.org ---
Let's keep the variadic concepts discussion in 66834.

*** This bug has been marked as a duplicate of bug 66834 ***


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

2015-07-12 Thread andrew.n.sutton at gmail dot com
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 ConstructibleT, 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.

templatetypename T, typename... Args
concept bool Constructible() {
  return std::is_constructibleT, Args...::value;
}


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

2015-07-12 Thread eric.niebler at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66841

--- Comment #2 from Eric Niebler eric.niebler at gmail dot com ---
This answer is deeply unsatisfying. I want valid expressions, not traits. And
if std::is_constructible doesn't do *exactly* what I want (and it doesn't) I
have to author my own trait, when what I want to do is author my own concept.

I'm not trying to do anything exotic here. There should be a way to do it
without resorting to metaprogramming trickery and SFINAE.