Open
Description
The following valid program is rejected by clang: Demo
struct A {
A() {}
A(A&&) = default;
void f(this A) {}
void operator() (this A) {}
};
int main() {
A{}.f(); // ok
A{}(); // Clang rejects while gcc and msvc accepts
}
As per over.call, the expression A{}()
is equivalent to(interpreted as) A{}.operator()()
which clang accepts.