I don't know whether it is appropriate to ask this question here and I'm sorry if I'm not supposed to.
I've been trying to implement some parts of P2300 myself as a challenge, but there's always something wrong with receiver_adaptor. The code compiles for clang and MSVC, but not for gcc. I tried a reduced example on compiler explorer and it seems that the compilers differ in behavior dealing with requires { typename Derived::name; }. If the derived type has defined a name member function template it seems to shadow the type alias in the CRTP base, but gcc still disambiguate typename Derived::name as a type even if the name is shadowed by a function template. (https://godbolt.org/z/63McMrWW8)
Am I missing some details or is the behavior of gcc faulty on this issue?
i'm pretty sure receiver_adaptor as specified should work, but i too struggled getting compilers to accept it. i think gcc is in error. clang gets it right.
I don't know whether it is appropriate to ask this question here and I'm sorry if I'm not supposed to.
I've been trying to implement some parts of P2300 myself as a challenge, but there's always something wrong with
receiver_adaptor
. The code compiles for clang and MSVC, but not for gcc. I tried a reduced example on compiler explorer and it seems that the compilers differ in behavior dealing withrequires { typename Derived::name; }
. If the derived type has defined aname
member function template it seems to shadow the type alias in the CRTP base, but gcc still disambiguatetypename Derived::name
as a type even if thename
is shadowed by a function template. (https://godbolt.org/z/63McMrWW8)Am I missing some details or is the behavior of gcc faulty on this issue?