Re: [C++ Patch / RFC] PR 50864

2011-11-07 Thread Paolo Carlini
On 11/07/2011 10:45 PM, Jason Merrill wrote: On 10/26/2011 04:35 PM, Paolo Carlini wrote: We have that parser->scope is a RECORD_TYPE and postfix_expression is an INDIRECT_REF. Ah, OK. I guess we swallow up the namespace while parsing the full nested-name-specifier and it isn't a problem. So

Re: [C++ Patch / RFC] PR 50864

2011-11-07 Thread Jason Merrill
On 10/26/2011 04:35 PM, Paolo Carlini wrote: We have that parser->scope is a RECORD_TYPE and postfix_expression is an INDIRECT_REF. Ah, OK. I guess we swallow up the namespace while parsing the full nested-name-specifier and it isn't a problem. So I think handling this here should be OK. B

Re: [C++ Patch / RFC] PR 50864

2011-10-26 Thread Paolo Carlini
On 10/26/2011 10:35 PM, Paolo Carlini wrote: On 10/26/2011 10:30 PM, Paolo Carlini wrote: Hi, At a glance, it looks too early; it's valid to have namespace-qualified names after ->. namespace A { struct B { int i; }; }; A::B* b; int i = b->A::B::i; I was also trying to construct su

Re: [C++ Patch / RFC] PR 50864

2011-10-26 Thread Paolo Carlini
On 10/26/2011 10:30 PM, Paolo Carlini wrote: Hi, At a glance, it looks too early; it's valid to have namespace-qualified names after ->. namespace A { struct B { int i; }; }; A::B* b; int i = b->A::B::i; I was also trying to construct such kind of example myself... but my patch doe

Re: [C++ Patch / RFC] PR 50864

2011-10-26 Thread Paolo Carlini
Hi, At a glance, it looks too early; it's valid to have namespace-qualified names after ->. namespace A { struct B { int i; }; }; A::B* b; int i = b->A::B::i; I was also trying to construct such kind of example myself... but my patch does not regress on the testcase you wrote down.

Re: [C++ Patch / RFC] PR 50864

2011-10-26 Thread Jason Merrill
On 10/26/2011 04:04 PM, Paolo Carlini wrote: The below tries to catch the problem very early, in cp_parser_postfix_dot_deref_expression and apparently works fine, passes the testsuite, etc. Is it too early? Is the check tight enough? At a glance, it looks too early; it's valid to have namespace

[C++ Patch / RFC] PR 50864

2011-10-26 Thread Paolo Carlini
Hi, one more / RFC, for the ICE on invalid part of these issues with '->'. The below tries to catch the problem very early, in cp_parser_postfix_dot_deref_expression and apparently works fine, passes the testsuite, etc. Is it too early? Is the check tight enough? Thanks, Paolo.