Re: [C++ Patch] PR 70808 ("Spurious -Wzero-as-null-pointer-constant for nullptr_t")

2018-04-11 Thread Paolo Carlini
Hi, On 11/04/2018 17:57, Jakub Jelinek wrote: On Tue, Apr 10, 2018 at 08:57:22PM +0200, Paolo Carlini wrote: 2018-04-10 Paolo Carlini PR c++/70808 * g++.dg/warn/Wzero-as-null-pointer-constant-7.C: New. The testcase FAILs in -std=c++98 mode for obvious reasons. Indeed, thank

Re: [C++ Patch] PR 70808 ("Spurious -Wzero-as-null-pointer-constant for nullptr_t")

2018-04-11 Thread Jakub Jelinek
On Tue, Apr 10, 2018 at 08:57:22PM +0200, Paolo Carlini wrote: > 2018-04-10 Paolo Carlini > > PR c++/70808 > * g++.dg/warn/Wzero-as-null-pointer-constant-7.C: New. The testcase FAILs in -std=c++98 mode for obvious reasons. I've committed following after testing it with make check-

Re: [C++ Patch] PR 70808 ("Spurious -Wzero-as-null-pointer-constant for nullptr_t")

2018-04-10 Thread Jason Merrill
OK. On Tue, Apr 10, 2018 at 2:57 PM, Paolo Carlini wrote: > Hi, > > this isn't a regression, but deciding what we want to do should be easy and > quick enough. The issue is that "mysteriously" we warn > -Wzero-as-null-pointer-constant for: > > decltype( nullptr ) warn = {}; > > and we don't for:

[C++ Patch] PR 70808 ("Spurious -Wzero-as-null-pointer-constant for nullptr_t")

2018-04-10 Thread Paolo Carlini
Hi, this isn't a regression, but deciding what we want to do should be easy and quick enough. The issue is that "mysteriously" we warn -Wzero-as-null-pointer-constant for: decltype( nullptr ) warn = {}; and we don't for: int* no_warn = {}; That's easily explained given the code we have in