Community
Participate
Working Groups
For the following code: struct A { int x; }; struct B { A f(int); }; template <typename Functor> void g(Functor functor) { B b; int y = b.f(functor()).x; // ERRORS HERE } The parser gives two errors at the indicated line: - Field 'x' could not be resolved - Invalid arguments ' Candidates are: A f These are bogus errors. The code is valid if g is instantiated with a Functor that does indeed return an int. At most, the parser could complain if it detects that g is in fact being instantiated with a Functor that does not return an int, but even in that case the error should be at the instantiation site, not the definition site.
Same root cause (function call on dependent name) as in bug 337686. *** This bug has been marked as a duplicate of bug 337686 ***