I was trying to reuse the return type of an operator in my trailing return type of another function, but unfortunately clang did not accept it
struct A {
int operator[](int);
auto at(int i) -> decltype((*this)[i]);
};
Clang says that my class does not have a operator[]. Gcc did accept my code. Is my code actually invalid?
I would say that clang is correct, due to 13.3.1.2p3 (1st bullet).
(emphasis added by @sehe)