Today I was faced with a problem that has not yet been overcome. To explain it I wrote a little program which produces compile-time error at line 48, and error is:
error: request for member 'value' in 'a2', which is of non-class type 'A ()(B (*)())'
is always parsed as a function declaration. The example from Wikipedia involves an extra set of parentheses. Doesn't the parser look for identifiers in a symbol table? The parser has all the elements needed to know that it's an object, not a type. And in C++ an object is never a type. What would be the type of the argument expected by the declared function?