You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.