Community
Participate
Working Groups
Build Identifier: I20110613-1736 In the first following two code examples, the bindings which are returned for name "f" are CPPField bindings (even if the code won't compile). In the third code example the retuned binding is a ProblemBinding. Would it not be nice to have all the (more or less similar) cases behave in the same way? Actually, I would prefer that for all cases, a ProblemBinding should be retuned. Since ProblemBinding can contain a reason about whats wrong, this would be very helpful. Reasons like "accessing none-static members in static way" or "access not allowed to private member" would be great. What do you think on this issue? Reproducible: Always Steps to Reproduce: Example 1. struct X { private: static int f; }; int main() { X::f = 5; } Example 2. struct X { int f; }; int main() { X::f = 5; } Example 3. struct X { void f(); }; int main() { X::f(); }
The parser does not go beyond name-resolution and that makes sense. In the case of function calls the parser needs to perform overload resolution, which does detect the missing implicit object parameter for calling f().