Re: [PATCH] c++: Don't hide narrowing errors in system headers

2021-07-16 Thread Jason Merrill via Gcc-patches
On 7/15/21 8:03 PM, Marek Polacek wrote: Jonathan pointed me at this issue where constexpr unsigned f() { constexpr int n = -1; return unsigned{n}; } is accepted in system headers, despite the narrowing conversion from a constant. I suspect that whereas narrowing warnings should be disabled

[PATCH] c++: Don't hide narrowing errors in system headers

2021-07-15 Thread Marek Polacek via Gcc-patches
Jonathan pointed me at this issue where constexpr unsigned f() { constexpr int n = -1; return unsigned{n}; } is accepted in system headers, despite the narrowing conversion from a constant. I suspect that whereas narrowing warnings should be disabled, ill-formed narrowing of constants should b