[Bug c++/82247] New: [concepts] Name deduction in concepts fails depending on the argument type
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 #include template bool concept Fooable = requires(const T& t) { { foo(t) }; // foo is unknown here }; template void foo(T&& t) { } template void bar(T&& t) { } class K { int x = 0; }; class WTF { std::vector values; }; int main() { // int i{}; // FAIL // K i; // SUCCEED // float i; // FAIL // std::string i; // FAIL? // std::vector 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.
[Bug c++/82247] [concepts] Name deduction in concepts fails depending on the argument type
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82247 --- Comment #1 from Joël Lamotte --- Just so that it's clear, it's on godbolt's compiler that I tried this: https://godbolt.org/g/d78J4H
[Bug c++/82247] [concepts] Name deduction in concepts fails depending on the argument type
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82247 --- Comment #3 from Joël Lamotte --- Sorry, I though you would see the flaga in the llink to godbolt I provided: --std=c++17 -fconcepts -O3 The code I provided in the report do compile, the problem is explained through the comments that if uncommented will not compile. All these lines, when uncommented exclusively, Should all compile.
[Bug c++/82247] [concepts] Name deduction in concepts fails depending on the argument type
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82247 --- Comment #5 from Joël Lamotte --- I'll have to recheck when I have access to a proper computer, but that indeed would explain this(weird) behavior. My understanding was that for basic types, ADL would still work using global namespace, which is why I didn't expect the int case to fail.
[Bug c++/82247] [concepts] Name deduction in concepts fails depending on the argument type
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82247 Joël Lamotte changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #6 from Joël Lamotte --- I confirm that the code is valid and my understanding of part of two-phase lookup mislead me to not understand why these lines fails compiling.
[Bug c++/67491] [meta-bug] concepts issues
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67491 Bug 67491 depends on bug 82247, which changed state. Bug 82247 Summary: [concepts] Name deduction in concepts fails depending on the argument type https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82247 What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID