[Bug c++/95242] [10/11 Regression] spurious "warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]" on comparisons with -std=c++2a

2020-05-27 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95242 Jason Merrill changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|---

[Bug c++/95242] [10/11 Regression] spurious "warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]" on comparisons with -std=c++2a

2020-05-27 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95242 --- Comment #6 from Jonathan Wakely --- It was just a sketch to show the idea. Obviously the real thing would need noexcept, but we have a regression test for that. How to construct it is what's relevant here.

[Bug c++/95242] [10/11 Regression] spurious "warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]" on comparisons with -std=c++2a

2020-05-27 Thread daniel.kruegler at googlemail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95242 --- Comment #5 from Daniel Krügler --- (In reply to Jonathan Wakely from comment #4) > It's consteval, the throw is there to make it not a constant expression and > give an error if anything except 0 is used. i.e. it can never throw, it > either

[Bug c++/95242] [10/11 Regression] spurious "warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]" on comparisons with -std=c++2a

2020-05-27 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95242 --- Comment #4 from Jonathan Wakely --- It's consteval, the throw is there to make it not a constant expression and give an error if anything except 0 is used. i.e. it can never throw, it either compiles or it doesn't. But I've remembered the

[Bug c++/95242] [10/11 Regression] spurious "warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]" on comparisons with -std=c++2a

2020-05-26 Thread daniel.kruegler at googlemail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95242 --- Comment #3 from Daniel Krügler --- (In reply to Jonathan Wakely from comment #2) > Another way to implement the __unspec constructor would be: > > consteval __unspec(int __n) { if (__n != 0) throw __n; } > > But I think I discussed this

[Bug c++/95242] [10/11 Regression] spurious "warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]" on comparisons with -std=c++2a

2020-05-26 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95242 --- Comment #2 from Jonathan Wakely --- Another way to implement the __unspec constructor would be: consteval __unspec(int __n) { if (__n != 0) throw __n; } But I think I discussed this with Richard Smith in Prague and we realised there was

[Bug c++/95242] [10/11 Regression] spurious "warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]" on comparisons with -std=c++2a

2020-05-26 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95242 Jason Merrill changed: What|Removed |Added Status|UNCONFIRMED |ASSIGNED Ever confirmed|0

[Bug c++/95242] [10/11 Regression] spurious "warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]" on comparisons with -std=c++2a

2020-05-22 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95242 Richard Biener changed: What|Removed |Added Known to work||9.3.0 Keywords|