------- Comment #3 from nickc at redhat dot com 2008-11-10 13:49 ------- Hi Guys,
I have uploaded a potential patch for the problem. It fixes the testcase originally provided and does not introduce any regressions into the g++ testsuite for an i686-pc-linux-gnu toolchain. That's the good news. The bad news is that I am not sure if the patch will be acceptable since I am not a C++ expert. The problem I believe is that the status of the cp_id_kind enum which is computed by cp_parser_postfix_dot_deref_expression() when it is parsing "A::get" is not passed back to cp_parse_primary_expression() which is currently parsing "(p->A::get)". So it goes with its default value, which allows overloading of virtual functions, and so the wrong member function is selected. The patch attempts to fix this problem by allowing the cp_id_kind enum computed in cp_parser_postfix_dot_deref_expression to be passes back, via a long chain of intermediary functions, to cp_parser_primary_expression. My concern is that I am not familiar enough with the C++ parser to tell if the patch breaks some other parser requirement. (One that is not tested by the g++ testsuite). So - is this patch acceptable ? Cheers Nick -- nickc at redhat dot com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |WAITING http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37862