Should the following sample compile?
struct B;
struct A
{
A(B*&&){}
};
struct B : A
{
B() : A(this){}
};
int main(){}
On LWS with clang it compiles, but with gcc I get:
no known conversion for argument 1 from 'B* const' to 'B*&&'
and if I add a const
it compiles.
I would like to also point out MSVC gets it wrong too:
cannot convert parameter 2 from 'B *const ' to 'B *&&'
so it looks like we have a bug in two compilers.
BUGS FILED
See Question&Answers more detail:os