https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82247
Bug ID: 82247 Summary: [concepts] Name deduction in concepts fails depending on the argument type Product: gcc Version: 7.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: mjklaim at gmail dot com Target Milestone: --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #include <string> #include <vector> template <typename T> bool concept Fooable = requires(const T& t) { { foo(t) }; // foo is unknown here }; template <typename T> void foo(T&& t) { } template <Fooable T> void bar(T&& t) { } class K { int x = 0; }; class WTF { std::vector<int> values; }; int main() { // int i{}; // FAIL // K i; // SUCCEED // float i; // FAIL // std::string i; // FAIL????? // std::vector<int> i; // FAIL????? // auto i =[]{}; // SUCCEED // int i[42]; // FAIL // int* i = nullptr; WTF i; // SUCCEED HAHAHAHA bar(i); }~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ All these lines should have succeded, but only using the custom types worked. I have no idea what is wrong here but it seem that even for int, the deduction of the foo function is not done at the right time.