Re: [C++ Patch/RFC] PR 70572 ("[4.9/5/6/7 Regression] ICE on code with decltype (auto) on x86_64-linux-gnu in digest_init_r")

2016-06-14 Thread Jason Merrill
On Wed, Jun 8, 2016 at 4:21 AM, Paolo Carlini wrote: > .. shall we fix this in gcc-6-branch too or not? It's just an ICE on invalid > but we don't emit any diagnostic before the crash. Sure, it should be safe enough. Jason

Re: [C++ Patch/RFC] PR 70572 ("[4.9/5/6/7 Regression] ICE on code with decltype (auto) on x86_64-linux-gnu in digest_init_r")

2016-06-08 Thread Paolo Carlini
.. shall we fix this in gcc-6-branch too or not? It's just an ICE on invalid but we don't emit any diagnostic before the crash. Thanks, Paolo.

Re: [C++ Patch/RFC] PR 70572 ("[4.9/5/6/7 Regression] ICE on code with decltype (auto) on x86_64-linux-gnu in digest_init_r")

2016-05-20 Thread Paolo Carlini
Hi, On 20/05/2016 17:24, Jason Merrill wrote: On 05/20/2016 07:17 AM, Paolo Carlini wrote: The below passes testing. There are a few minor changes wrt your suggestions (I think we want & as hint; I disagree; if what the user wanted was a function pointer, there's no reason to use

Re: [C++ Patch/RFC] PR 70572 ("[4.9/5/6/7 Regression] ICE on code with decltype (auto) on x86_64-linux-gnu in digest_init_r")

2016-05-20 Thread Jason Merrill
On 05/20/2016 07:17 AM, Paolo Carlini wrote: The below passes testing. There are a few minor changes wrt your suggestions (I think we want & as hint; I disagree; if what the user wanted was a function pointer, there's no reason to use decltype(auto) over plain auto. Much more likely that

Re: [C++ Patch/RFC] PR 70572 ("[4.9/5/6/7 Regression] ICE on code with decltype (auto) on x86_64-linux-gnu in digest_init_r")

2016-05-20 Thread Paolo Carlini
Hi, On 19/05/2016 15:58, Jason Merrill wrote: On 05/18/2016 07:13 PM, Paolo Carlini wrote: + error ("cannot declare variable %q+D with function type", decl); I think the error message would be more helpful if it mentioned decltype(auto), maybe "initializer for %

Re: [C++ Patch/RFC] PR 70572 ("[4.9/5/6/7 Regression] ICE on code with decltype (auto) on x86_64-linux-gnu in digest_init_r")

2016-05-19 Thread Jason Merrill
On 05/18/2016 07:13 PM, Paolo Carlini wrote: + error ("cannot declare variable %q+D with function type", decl); I think the error message would be more helpful if it mentioned decltype(auto), maybe "initializer for % has function type, did you forget the

Re: [C++ Patch/RFC] PR 70572 ("[4.9/5/6/7 Regression] ICE on code with decltype (auto) on x86_64-linux-gnu in digest_init_r")

2016-05-18 Thread Paolo Carlini
Hi, On 18/05/2016 23:13, Jason Merrill wrote: Shouldn't we have complained about declaring a variable with function type before we get here? Ah, interesting, I think all the other compilers I have at hand don't even try to catch the issue so early. In any case, something as simple as the

Re: [C++ Patch/RFC] PR 70572 ("[4.9/5/6/7 Regression] ICE on code with decltype (auto) on x86_64-linux-gnu in digest_init_r")

2016-05-18 Thread Jason Merrill
On 05/18/2016 11:48 AM, Paolo Carlini wrote: Hi, this issue should be easy to fix. Broken code like: void foo () { decltype (auto) a = foo; } triggers the gcc_assert in digest_init_r: /* Come here only for aggregates: records, arrays, unions, complex numbers and vectors. */

[C++ Patch/RFC] PR 70572 ("[4.9/5/6/7 Regression] ICE on code with decltype (auto) on x86_64-linux-gnu in digest_init_r")

2016-05-18 Thread Paolo Carlini
Hi, this issue should be easy to fix. Broken code like: void foo () { decltype (auto) a = foo; } triggers the gcc_assert in digest_init_r: /* Come here only for aggregates: records, arrays, unions, complex numbers and vectors. */ gcc_assert (TREE_CODE (type) == ARRAY_TYPE