Re: [C++ Patch] PR 84588 ("[8 Regression] internal compiler error: Segmentation fault (contains_struct_check())")​ (Take 2)

2018-05-21 Thread Jason Merrill
OK. On Mon, May 21, 2018 at 8:41 AM, Paolo Carlini wrote: > Hi again, > > On 19/05/2018 15:30, Jason Merrill wrote: >> >> How about doing cp_parser_commit_to_tentative_parse if we see >> something that must be a declaration? cp_parser_simple_declaration >> has >> >>

Re: [C++ Patch] PR 84588 ("[8 Regression] internal compiler error: Segmentation fault (contains_struct_check())")​ (Take 2)

2018-05-21 Thread Paolo Carlini
Hi again, On 19/05/2018 15:30, Jason Merrill wrote: How about doing cp_parser_commit_to_tentative_parse if we see something that must be a declaration? cp_parser_simple_declaration has /* If we have seen at least one decl-specifier, and the next token is not a parenthesis, then we

Re: [C++ Patch] PR 84588 ("[8 Regression] internal compiler error: Segmentation fault (contains_struct_check())")​ (Take 2)

2018-05-20 Thread Paolo Carlini
Hi, On 19/05/2018 15:30, Jason Merrill wrote: I would expect it to cause different diagnostic issues, from complaining about something not being a proper declaration when it's really an expression. I also wonder about warning problems (either missed or bogus) due to trying these in a different

Re: [C++ Patch] PR 84588 ("[8 Regression] internal compiler error: Segmentation fault (contains_struct_check())")​ (Take 2)

2018-05-19 Thread Jason Merrill
On Fri, May 18, 2018 at 8:27 PM, Paolo Carlini wrote: > On 19/05/2018 01:40, Jason Merrill wrote: >> On Fri, May 18, 2018 at 1:40 PM, Paolo Carlini >> wrote: >>> >>> Hi again, >>> >>> I'm playing with a wild, wild idea: would it make sense to

Re: [C++ Patch] PR 84588 ("[8 Regression] internal compiler error: Segmentation fault (contains_struct_check())")​ (Take 2)

2018-05-18 Thread Paolo Carlini
Hi, On 19/05/2018 01:40, Jason Merrill wrote: On Fri, May 18, 2018 at 1:40 PM, Paolo Carlini wrote: Hi again, I'm playing with a wild, wild idea: would it make sense to try *first* an expression? Because, a quickly hacked draft appears to handle very elegantly all

Re: [C++ Patch] PR 84588 ("[8 Regression] internal compiler error: Segmentation fault (contains_struct_check())")​ (Take 2)

2018-05-18 Thread Jason Merrill
On Fri, May 18, 2018 at 1:40 PM, Paolo Carlini wrote: > Hi again, > > I'm playing with a wild, wild idea: would it make sense to try *first* an > expression? Because, a quickly hacked draft appears to handle very elegantly > all the possible cases of "junk" after the

Re: [C++ Patch] PR 84588 ("[8 Regression] internal compiler error: Segmentation fault (contains_struct_check())")​ (Take 2)

2018-05-18 Thread Paolo Carlini
Hi again, I'm playing with a wild, wild idea: would it make sense to try *first* an expression? Because, a quickly hacked draft appears to handle very elegantly all the possible cases of "junk" after the declarator, eg:     void foo()     {         if (void bar()JUNK); } and the

Re: [C++ Patch] PR 84588 ("[8 Regression] internal compiler error: Segmentation fault (contains_struct_check())")​ (Take 2)

2018-05-18 Thread Paolo Carlini
Hi, On 18/05/2018 16:45, Jason Merrill wrote: I guess it's desirable to also give this error when the declarator is followed by ) or ; rather than other tokens that could be more expression (like in A(a).x in the comment). I can certainly try to implement this, maybe just something minimal to

Re: [C++ Patch] PR 84588 ("[8 Regression] internal compiler error: Segmentation fault (contains_struct_check())")​ (Take 2)

2018-05-18 Thread Jason Merrill
On Fri, May 18, 2018 at 10:30 AM, Paolo Carlini wrote: > Hi, > > On 18/05/2018 16:19, Jason Merrill wrote: >> >> On Fri, May 18, 2018 at 10:05 AM, Paolo Carlini >> wrote: >>> >>> Hi, >>> >>> On 18/05/2018 15:56, Jason Merrill wrote: I

Re: [C++ Patch] PR 84588 ("[8 Regression] internal compiler error: Segmentation fault (contains_struct_check())")​ (Take 2)

2018-05-18 Thread Paolo Carlini
Hi, On 18/05/2018 16:19, Jason Merrill wrote: On Fri, May 18, 2018 at 10:05 AM, Paolo Carlini wrote: Hi, On 18/05/2018 15:56, Jason Merrill wrote: I had in mind moving the call to cp_parser_check_condition_declarator into the block controlled by

Re: [C++ Patch] PR 84588 ("[8 Regression] internal compiler error: Segmentation fault (contains_struct_check())")​ (Take 2)

2018-05-18 Thread Jason Merrill
On Fri, May 18, 2018 at 10:05 AM, Paolo Carlini wrote: > Hi, > > On 18/05/2018 15:56, Jason Merrill wrote: >> >> I had in mind moving the call to cp_parser_check_condition_declarator >> into the block controlled by cp_parser_parse_definitely; this is a >> semantic check

Re: [C++ Patch] PR 84588 ("[8 Regression] internal compiler error: Segmentation fault (contains_struct_check())")​ (Take 2)

2018-05-18 Thread Paolo Carlini
Hi, On 18/05/2018 15:56, Jason Merrill wrote: I had in mind moving the call to cp_parser_check_condition_declarator into the block controlled by cp_parser_parse_definitely; this is a semantic check that should follow the syntactic checks. If there's no initializer, it doesn't parse as a

Re: [C++ Patch] PR 84588 ("[8 Regression] internal compiler error: Segmentation fault (contains_struct_check())")​ (Take 2)

2018-05-18 Thread Jason Merrill
On Fri, May 18, 2018 at 4:41 AM, Paolo Carlini wrote: > Hi, > >>> On 18/05/2018 01:21, Jason Merrill wrote: On Thu, May 17, 2018 at 5:54 PM, Paolo Carlini wrote: > > On 17/05/2018 16:58, Jason Merrill wrote: >> >>

Re: [C++ Patch] PR 84588 ("[8 Regression] internal compiler error: Segmentation fault (contains_struct_check())")​ (Take 2)

2018-05-18 Thread Paolo Carlini
Hi, On 18/05/2018 01:21, Jason Merrill wrote: On Thu, May 17, 2018 at 5:54 PM, Paolo Carlini wrote: On 17/05/2018 16:58, Jason Merrill wrote: On Thu, May 17, 2018 at 10:27 AM, Paolo Carlini wrote: PS: maybe better using

Re: [C++ Patch] PR 84588 ("[8 Regression] internal compiler error: Segmentation fault (contains_struct_check())")​ (Take 2)

2018-05-17 Thread Paolo Carlini
Hi again, On 18/05/2018 02:31, Paolo Carlini wrote: Hi, On 18/05/2018 01:21, Jason Merrill wrote: On Thu, May 17, 2018 at 5:54 PM, Paolo Carlini wrote: On 17/05/2018 16:58, Jason Merrill wrote: On Thu, May 17, 2018 at 10:27 AM, Paolo Carlini

Re: [C++ Patch] PR 84588 ("[8 Regression] internal compiler error: Segmentation fault (contains_struct_check())")​ (Take 2)

2018-05-17 Thread Paolo Carlini
Hi, On 18/05/2018 01:21, Jason Merrill wrote: On Thu, May 17, 2018 at 5:54 PM, Paolo Carlini wrote: On 17/05/2018 16:58, Jason Merrill wrote: On Thu, May 17, 2018 at 10:27 AM, Paolo Carlini wrote: PS: maybe better using

Re: [C++ Patch] PR 84588 ("[8 Regression] internal compiler error: Segmentation fault (contains_struct_check())")​ (Take 2)

2018-05-17 Thread Jason Merrill
On Thu, May 17, 2018 at 5:54 PM, Paolo Carlini wrote: > On 17/05/2018 16:58, Jason Merrill wrote: >> >> On Thu, May 17, 2018 at 10:27 AM, Paolo Carlini >> wrote: >>> >>> PS: maybe better using function_declarator_p? >> >> I think so, yes. The

Re: [C++ Patch] PR 84588 ("[8 Regression] internal compiler error: Segmentation fault (contains_struct_check())")​ (Take 2)

2018-05-17 Thread Paolo Carlini
Hi, On 17/05/2018 16:58, Jason Merrill wrote: On Thu, May 17, 2018 at 10:27 AM, Paolo Carlini wrote: PS: maybe better using function_declarator_p? I think so, yes. The relevant rule seems to be "The declarator shall not specify a function or an array.", so let's

Re: [C++ Patch] PR 84588 ("[8 Regression] internal compiler error: Segmentation fault (contains_struct_check())")​ (Take 2)

2018-05-17 Thread Jason Merrill
On Thu, May 17, 2018 at 10:27 AM, Paolo Carlini wrote: > PS: maybe better using function_declarator_p? I think so, yes. The relevant rule seems to be "The declarator shall not specify a function or an array.", so let's check for arrays, too. Jason

Re: [C++ Patch] PR 84588 ("[8 Regression] internal compiler error: Segmentation fault (contains_struct_check())")​ (Take 2)

2018-05-17 Thread Paolo Carlini
PS: maybe better using function_declarator_p??? I think I regression tested that variant too, at some point. Paolo.

[C++ Patch] PR 84588 ("[8 Regression] internal compiler error: Segmentation fault (contains_struct_check())")​ (Take 2)

2018-05-17 Thread Paolo Carlini
Hi, thus I had to revert my first try, when it caused c++/85713. I added two testcases for the latter (the second one covering what I learned from yet another defective try which I attached to the trail of c++/84588 yesterday) and finally figured out that the problem was that I was

Re: [C++ Patch] PR 84588 ("[8 Regression] internal compiler error: Segmentation fault (contains_struct_check())")

2018-05-08 Thread Jason Merrill
On Tue, May 8, 2018 at 1:46 PM, Paolo Carlini wrote: > Hi, > > On 08/05/2018 19:15, Jason Merrill wrote: >> >> On Fri, Apr 20, 2018 at 1:46 PM, Paolo Carlini >> wrote: >>> >>> Hi, >>> >>> in this error-recovery regression, after sensible

Re: [C++ Patch] PR 84588 ("[8 Regression] internal compiler error: Segmentation fault (contains_struct_check())")

2018-05-08 Thread Paolo Carlini
Hi, On 08/05/2018 19:15, Jason Merrill wrote: On Fri, Apr 20, 2018 at 1:46 PM, Paolo Carlini wrote: Hi, in this error-recovery regression, after sensible diagnostic about "two or more data types in declaration..." we get confused, we issue a cryptic - but useful

Re: [C++ Patch] PR 84588 ("[8 Regression] internal compiler error: Segmentation fault (contains_struct_check())")

2018-05-08 Thread Jason Merrill
On Fri, Apr 20, 2018 at 1:46 PM, Paolo Carlini wrote: > Hi, > > in this error-recovery regression, after sensible diagnostic about "two or > more data types in declaration..." we get confused, we issue a cryptic - > but useful hint to somebody working on the present bug

[Ping] [C++ Patch] PR 84588 ("[8 Regression] internal compiler error: Segmentation fault (contains_struct_check())")

2018-05-08 Thread Paolo Carlini
Hi, On 20/04/2018 19:46, Paolo Carlini wrote: Hi, in this error-recovery regression, after sensible diagnostic about "two or more data types in declaration..." we get confused, we issue a cryptic -  but useful hint to somebody working on the present bug ;) - "template definition of

[C++ Patch] PR 84588 ("[8 Regression] internal compiler error: Segmentation fault (contains_struct_check())")

2018-04-20 Thread Paolo Carlini
Hi, in this error-recovery regression, after sensible diagnostic about "two or more data types in declaration..." we get confused, we issue a cryptic -  but useful hint to somebody working on the present bug ;) - "template definition of non-template" error and we finally crash. I think the