Re: [C++ Patch] PR 58650

2014-12-16 Thread Jason Merrill
OK, thanks. Jason

Re: [C++ Patch] PR 58650

2014-12-16 Thread Paolo Carlini
Hi, On 12/16/2014 07:18 PM, Jason Merrill wrote: On 12/16/2014 12:49 PM, Paolo Carlini wrote: I see what you mean: try to somehow realize that grokdeclarator issued an error and we are in error recovery. What about directly addressing NSDMIs, the specific case at issue, thus the below? A bit ad

Re: [C++ Patch] PR 58650

2014-12-16 Thread Jason Merrill
On 12/16/2014 12:49 PM, Paolo Carlini wrote: I see what you mean: try to somehow realize that grokdeclarator issued an error and we are in error recovery. What about directly addressing NSDMIs, the specific case at issue, thus the below? A bit ad-hoc-ish but on the other hand should be lighter th

Re: [C++ Patch] PR 58650

2014-12-16 Thread Paolo Carlini
Hi, On 12/16/2014 04:10 PM, Jason Merrill wrote: On 12/16/2014 05:40 AM, Paolo Carlini wrote: In better detail: grokdeclarator is called, via grokfield, by cp_parser_member_declaration. The latter stores the friendship information in a friend_p local flag, which remains true when grokdeclarator

Re: [C++ Patch] PR 58650

2014-12-16 Thread Jason Merrill
On 12/16/2014 05:40 AM, Paolo Carlini wrote: In better detail: grokdeclarator is called, via grokfield, by cp_parser_member_declaration. The latter stores the friendship information in a friend_p local flag, which remains true when grokdeclarator returns. Maybe check function_declarator_p in cp

Re: [C++ Patch] PR 58650

2014-12-16 Thread Paolo Carlini
Hi again, On 12/16/2014 11:17 AM, Paolo Carlini wrote: Hi, On 12/15/2014 11:25 PM, Jason Merrill wrote: Why does error recovery fail? I would expect to be able to just drop the 'friend' and treat it as a normal non-static data member. I agree, that was my first thought too. Unfortunately we d

Re: [C++ Patch] PR 58650

2014-12-16 Thread Paolo Carlini
Hi, On 12/15/2014 11:25 PM, Jason Merrill wrote: Why does error recovery fail? I would expect to be able to just drop the 'friend' and treat it as a normal non-static data member. I agree, that was my first thought too. Unfortunately we do non-trivial preparatory work *before* calling grokdecl

Re: [C++ Patch] PR 58650

2014-12-15 Thread Jason Merrill
Why does error recovery fail? I would expect to be able to just drop the 'friend' and treat it as a normal non-static data member. Jason

[C++ Patch] PR 58650

2014-12-15 Thread Paolo Carlini
Hi, avoid crashing later in build_this_parm during error recovery. Tested x86_64-linux. Thanks, Paolo. // /cp 2014-12-15 Paolo Carlini PR c++/58650 * decl.c (grokdeclarator): Avoid crashing on an initialized non-static data member wrongly declared f