[ Resending since this was somehow sent in HMTL mode and was scrubbed ]
On 30 Oct 2024, at 17:16, Simon Martin wrote:
> Hi,
>
> Just closing the loop on this...
>
> On 19 Oct 2024, at 11:57, Iain Sandoe wrote:
>
> On 19 Oct 2024, at 10:16, Simon Martin wrote:
>
> On 18 Oct 2024, at 10:55, Sam Ja
Hi,
Just closing the loop on this...
On 19 Oct 2024, at 11:57, Iain Sandoe wrote:
On 19 Oct 2024, at 10:16, Simon Martin wrote:
On 18 Oct 2024, at 10:55, Sam James wrote:
Simon Martin writes:
Hi Sam,
Hi Simon,
On 16 Oct 2024, at 22:06, Sam James wrote:
Simon Martin writes:
We ICE upon
> On 19 Oct 2024, at 10:16, Simon Martin wrote:
>
> On 18 Oct 2024, at 10:55, Sam James wrote:
>
>> Simon Martin writes:
>>
>>> Hi Sam,
>>
>> Hi Simon,
>>
>>>
>>> On 16 Oct 2024, at 22:06, Sam James wrote:
>>>
Simon Martin writes:
> We ICE upon the following invalid code
On 18 Oct 2024, at 10:55, Sam James wrote:
> Simon Martin writes:
>
>> Hi Sam,
>
> Hi Simon,
>
>>
>> On 16 Oct 2024, at 22:06, Sam James wrote:
>>
>>> Simon Martin writes:
>>>
We ICE upon the following invalid code because we end up calling
finalize_nrv_r with a RETURN_EXPR with no ope
Simon Martin writes:
> Hi Sam,
Hi Simon,
>
> On 16 Oct 2024, at 22:06, Sam James wrote:
>
>> Simon Martin writes:
>>
>>> We ICE upon the following invalid code because we end up calling
>>> finalize_nrv_r with a RETURN_EXPR with no operand.
>>>
>>> === cut here ===
>>> struct X {
>>> ~X();
>
~X();
>> +};
>> +
>> +X test(bool b) {
>> + {
>> +X x;
>> +return x;
>> + }
>> + if (!(b)) return; // { dg-error "return-statement with no value" }
>> +}
>> --
>> 2.44.0
>>
>
> BTW, the line-endings on this seem a bit odd. Di
Simon Martin writes:
> We ICE upon the following invalid code because we end up calling
> finalize_nrv_r with a RETURN_EXPR with no operand.
>
> === cut here ===
> struct X {
> ~X();
> };
> X test(bool b) {
> {
> X x;
> return x;
> }
> if (!(b)) return;
> }
> === cut here ===
>
We ICE upon the following invalid code because we end up calling
finalize_nrv_r with a RETURN_EXPR with no operand.
=== cut here ===
struct X {
~X();
};
X test(bool b) {
{
X x;
return x;
}
if (!(b)) return;
}
=== cut here ===
This patch fixes this by simply returning error_mark_no