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

2014-08-24 Thread Jason Merrill
OK. Jason

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

2014-08-23 Thread Paolo Carlini
Hi again, On 08/23/2014 09:16 AM, Paolo Carlini wrote: .. on the other hand, the below is a case which my patchlet, which simply tracks pointers, does *not* handle correctly: struct B { }; template struct A { }; A*p = 42; should be fixable by complicating a bit the tracking, telling apart m

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

2014-08-23 Thread Paolo Carlini
.. on the other hand, the below is a case which my patchlet, which simply tracks pointers, does *not* handle correctly: struct B { }; template struct A { }; A*p = 42; should be fixable by complicating a bit the tracking, telling apart member pointers. Paolo.

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

2014-08-22 Thread Paolo Carlini
Hi, On 08/22/2014 10:45 PM, Jason Merrill wrote: Does your patch handle this correctly? template struct A { }; A*p = 42; I would say yes: 34938_2.C:2:20: error: invalid conversion from ‘int’ to ‘Aconst>*’ [-fpermissive] A*p = 42; But, interestingly, in this case 4.8.x was incorrect, this

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

2014-08-22 Thread Jason Merrill
Does your patch handle this correctly? template struct A { }; A*p = 42; Jason

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

2014-08-22 Thread Paolo Carlini
Hi again, On 08/22/2014 09:33 PM, Paolo Carlini wrote: Hi, On 08/22/2014 09:27 PM, Jason Merrill wrote: On 08/22/2014 03:19 PM, Paolo Carlini wrote: Ok. Currently in cases like the present one, dump_type_suffix upon a pointer recurses and we end up calling pp_cxx_cv_qualifiers on the given F

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

2014-08-22 Thread Jason Merrill
On 08/22/2014 03:47 PM, Manuel López-Ibáñez wrote: Are there actually cases where the qualifiers mean different things for function_type and method_type? If a FUNCTION_TYPE is a typedef or template argument, TYPE_READONLY and TYPE_VOLATILE are the function-cv-quals. A plain METHOD_TYPE cannot

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

2014-08-22 Thread Manuel López-Ibáñez
On 22 August 2014 21:33, Paolo Carlini wrote: >> Incidentally, I don't understand >> >>> + pp_c_ws_string (pp, (func_type && !method_type >> >> vs >>> >>> + pp_c_ws_string (pp, (func_type || method_type >> >> >> Surely the same logic is appropriate for both const and noreturn, and they >

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

2014-08-22 Thread Paolo Carlini
Hi, On 08/22/2014 09:27 PM, Jason Merrill wrote: On 08/22/2014 03:19 PM, Paolo Carlini wrote: Ok. Currently in cases like the present one, dump_type_suffix upon a pointer recurses and we end up calling pp_cxx_cv_qualifiers on the given FUNCTION_TYPE / METHOD_TYPE. Thus pp_cxx_cv_qualifiers lack

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

2014-08-22 Thread Jason Merrill
On 08/22/2014 03:19 PM, Paolo Carlini wrote: Ok. Currently in cases like the present one, dump_type_suffix upon a pointer recurses and we end up calling pp_cxx_cv_qualifiers on the given FUNCTION_TYPE / METHOD_TYPE. Thus pp_cxx_cv_qualifiers lacks the pointer context, just sees the latter. Do you

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

2014-08-22 Thread Paolo Carlini
Hi, On 08/22/2014 08:17 PM, Jason Merrill wrote: On 08/22/2014 01:53 PM, Paolo Carlini wrote: maybe this old issue is already fixed. We used to ICE on: typedef void (*fptr)() __attribute((noreturn)); template void foo(); template void bar(); fptr f = bar< foo<0> >; but lately we simply rejec

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

2014-08-22 Thread Jason Merrill
On 08/22/2014 01:53 PM, Paolo Carlini wrote: maybe this old issue is already fixed. We used to ICE on: typedef void (*fptr)() __attribute((noreturn)); template void foo(); template void bar(); fptr f = bar< foo<0> >; but lately we simply reject it: 34938.C:5:10: error: no matches converting f

[C++ RFC/Patch] PR 34938

2014-08-22 Thread Paolo Carlini
Hi, maybe this old issue is already fixed. We used to ICE on: typedef void (*fptr)() __attribute((noreturn)); template void foo(); template void bar(); fptr f = bar< foo<0> >; but lately we simply reject it: 34938.C:5:10: error: no matches converting function ‘bar’ to type ‘fptr {aka void (*