Re: [PATCH] c++: diagnosing if-stmt with non-constant branches [PR105050]

2022-03-25 Thread Jason Merrill via Gcc-patches
On 3/25/22 12:07, Patrick Palka wrote: When an if-stmt is deemed non-constant because both of its branches are non-constant, we issue a rather generic error which, given that it points to the 'if' token, misleadingly suggests the condition is at fault: constexpr-105050.C:8:3: error: expressio

Re: [PATCH] c++: diagnosing if-stmt with non-constant branches [PR105050]

2022-03-25 Thread Marek Polacek via Gcc-patches
On Fri, Mar 25, 2022 at 12:07:31PM -0400, Patrick Palka via Gcc-patches wrote: > When an if-stmt is deemed non-constant because both of its branches are > non-constant, we issue a rather generic error which, given that it points > to the 'if' token, misleadingly suggests the condition is at fault:

[PATCH] c++: diagnosing if-stmt with non-constant branches [PR105050]

2022-03-25 Thread Patrick Palka via Gcc-patches
When an if-stmt is deemed non-constant because both of its branches are non-constant, we issue a rather generic error which, given that it points to the 'if' token, misleadingly suggests the condition is at fault: constexpr-105050.C:8:3: error: expression ‘’ is not a constant expression 8