https://bugs.llvm.org/show_bug.cgi?id=33904
Happens when static function is accessed via the class variable. That leads to incorrect overloads number because the variable is considered as the first argument.
struct Bar {
static void foo(); static void foo(int);
};
int main() {
Bar b; b.foo(/*complete here*/); // did not work before Bar::foo(/*complete here*/); // worked fine
}
This breaks normal (non-static) method overload resolution, since the this argument is now passed to AddMethodCandidate which is not expecting it. It always thinks too many arguments are passed to methods with no parameters; most other calls to AddMethodCandidate in SemaOverload.cpp don't pass the implicit this.