Let's use explicit location for the C++ front end warnings, too. OK
with that change.
Jason
On Sun, May 3, 2015 at 5:29 PM, Patrick Palka wrote:
> On Sun, Apr 26, 2015 at 8:56 PM, Patrick Palka wrote:
>> Here is an updated version of the patch with, hopefully, all your
>> suggestions made. I decided to add calls to STRIP_NOPS before emitting
>> the warning so that we properly warn for
On Sun, Apr 26, 2015 at 8:56 PM, Patrick Palka wrote:
> Here is an updated version of the patch with, hopefully, all your
> suggestions made. I decided to add calls to STRIP_NOPS before emitting
> the warning so that we properly warn for cases where there's a cast in
> between the whole thing, e.
Here is an updated version of the patch with, hopefully, all your
suggestions made. I decided to add calls to STRIP_NOPS before emitting
the warning so that we properly warn for cases where there's a cast in
between the whole thing, e.g.
if (!&(int &)a)
I also added guards to emit the warnings
On Thu, Apr 23, 2015 at 11:34 AM, Manuel López-Ibáñez
wrote:
> On 04/23/2015 05:12 PM, Jason Merrill wrote:
>>
>> On 04/20/2015 10:36 PM, Patrick Palka wrote:
>> Implementation is pretty straightforward. The only catch is that the
>> middle-end doesn't actually assume that REFERENCE_TYPEs are non
On 04/23/2015 11:34 AM, Manuel López-Ibáñez wrote:
It seems also weird we do not warn directly for '*(int *)0' in the C/C++
FE.
Agreed.
Using decl_with_nonnull_addr_p doesn't make sense for reference variables,
since we're using their pointer value rather than their address.
Is an extra che
On 04/23/2015 05:12 PM, Jason Merrill wrote:
On 04/20/2015 10:36 PM, Patrick Palka wrote:
Implementation is pretty straightforward. The only catch is that the
middle-end doesn't actually assume that REFERENCE_TYPEs are non-NULL so
code like
int &a = *(int *)0;
if (&a != 0)
will warn th
On 04/20/2015 10:36 PM, Patrick Palka wrote:
+ if (decl_with_nonnull_addr_p (inner))
Using decl_with_nonnull_addr_p doesn't make sense for reference
variables, since we're using their pointer value rather than their address.
+ warning_at (location,
+
Implementation is pretty straightforward. The only catch is that the
middle-end doesn't actually assume that REFERENCE_TYPEs are non-NULL so
code like
int &a = *(int *)0;
if (&a != 0)
will warn that &a will never be NULL yet the middle-end will fold the
conditional to false instead of tr