Re: [PATCH] Fix some blockers of PR c++/24666 (arrays decay to pointers too early)

2015-12-17 Thread Patrick Palka
On Thu, 17 Dec 2015, Paolo Carlini wrote: Hi, On 16/12/2015 23:10, Patrick Palka wrote: gcc/cp/ChangeLog: PR c++/59878 * typeck.c (convert_for_initialization): Don't perform an early decaying conversion if converting to a class type. gcc/testsuite/ChangeLog: PR c++/59878

Re: [PATCH] Fix some blockers of PR c++/24666 (arrays decay to pointers too early)

2015-12-17 Thread Paolo Carlini
Hi, On 16/12/2015 23:10, Patrick Palka wrote: gcc/cp/ChangeLog: PR c++/59878 * typeck.c (convert_for_initialization): Don't perform an early decaying conversion if converting to a class type. gcc/testsuite/ChangeLog: PR c++/59878 * g++.dg/conversion/pr59878.C: New test. Ni

Re: [PATCH] Fix some blockers of PR c++/24666 (arrays decay to pointers too early)

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

Re: [PATCH] Fix some blockers of PR c++/24666 (arrays decay to pointers too early)

2015-12-16 Thread Patrick Palka
On Wed, 16 Dec 2015, Jason Merrill wrote: On 12/15/2015 04:16 PM, Patrick Palka wrote: + if (MAYBE_CLASS_TYPE_P (type)) +; What does this patch do with conversion to const reference to class? I think we want to check MAYBE_CLASS_TYPE_P (non_reference (type)) here. That makes sense.

Re: [PATCH] Fix some blockers of PR c++/24666 (arrays decay to pointers too early)

2015-12-16 Thread Jason Merrill
On 12/15/2015 04:16 PM, Patrick Palka wrote: + if (MAYBE_CLASS_TYPE_P (type)) +; What does this patch do with conversion to const reference to class? I think we want to check MAYBE_CLASS_TYPE_P (non_reference (type)) here. Jason

[PATCH] Fix some blockers of PR c++/24666 (arrays decay to pointers too early)

2015-12-15 Thread Patrick Palka
This patch just makes convert_for_initialization() to avoid eagerly decaying an array, function, etc if the type we're converting to is a class type, so that the correct conversion constructor could be later be selected in perform_implicit_conversion_flags(). Bootstrap + regtest in progress on x86