[Bug c++/80472] cannot use push/pop with #pragma GCC diagnostic warning "-Wsystem-headers"

2019-03-22 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80472 --- Comment #13 from Jonathan Wakely --- (In reply to Jonathan Wakely from comment #12) > Improving the warning in comment 4 is irrelevant to this bug. I've created Bug 89800 for improving that warning, please move that discussion there.

[Bug c++/80472] cannot use push/pop with #pragma GCC diagnostic warning "-Wsystem-headers"

2019-03-22 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80472 --- Comment #12 from Jonathan Wakely --- And as I've already said, the quality of the particular -Waggressive-loop-optimizations warning is a separate issue, and should be dealt with in a separate PR. PR 58876 (mentioned in comment 0 as the

[Bug c++/80472] cannot use push/pop with #pragma GCC diagnostic warning "-Wsystem-headers"

2019-03-22 Thread lopezibanez at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80472 --- Comment #11 from Manuel López-Ibáñez --- I'm not being pedantic for the sake of being pedantic. It is trivial to fix the #pragma as I explained above. However, that won't give the user any idea about which user code is triggering the

[Bug c++/80472] cannot use push/pop with #pragma GCC diagnostic warning "-Wsystem-headers"

2019-03-22 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80472 --- Comment #10 from Jonathan Wakely --- (In reply to Manuel López-Ibáñez from comment #8) > There is no negative n__ in user code. If you want to be pedantic, there's no __n at all in user code. Because it's a function parameter of

[Bug c++/80472] cannot use push/pop with #pragma GCC diagnostic warning "-Wsystem-headers"

2019-03-22 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80472 --- Comment #9 from Jonathan Wakely --- There is though. std::prev(it, n) is specified as std::advance(it, -n). Calling prev means advancing a negative amount. But I'm not sure what your point is. Currently there's no warning by default even

[Bug c++/80472] cannot use push/pop with #pragma GCC diagnostic warning "-Wsystem-headers"

2019-03-22 Thread lopezibanez at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80472 --- Comment #8 from Manuel López-Ibáñez --- There is no negative n__ in user code. On Fri, 22 Mar 2019, 21:21 redi at gcc dot gnu.org, < gcc-bugzi...@gcc.gnu.org> wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80472 > > --- Comment #7

[Bug c++/80472] cannot use push/pop with #pragma GCC diagnostic warning "-Wsystem-headers"

2019-03-22 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80472 --- Comment #7 from Jonathan Wakely --- A comment added to the code would make the caret diagnostic self-explanatory: --- a/libstdc++-v3/include/bits/stl_iterator_base_funcs.h +++ b/libstdc++-v3/include/bits/stl_iterator_base_funcs.h @@ -149,7

[Bug c++/80472] cannot use push/pop with #pragma GCC diagnostic warning "-Wsystem-headers"

2019-03-22 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80472 --- Comment #6 from Jonathan Wakely --- Is it better to silently generate code with undefined behaviour, or issue a flawed warning about that undefined behaviour? If the warning doesn't show the template instantiation context that's a separate

[Bug c++/80472] cannot use push/pop with #pragma GCC diagnostic warning "-Wsystem-headers"

2019-03-22 Thread lopezibanez at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80472 --- Comment #5 from Manuel López-Ibáñez --- This warning will be incomprehensible to users because the warning never mentions any code that the user can modify. What should the user do according to the warning?

[Bug c++/80472] cannot use push/pop with #pragma GCC diagnostic warning "-Wsystem-headers"

2019-03-22 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80472 --- Comment #4 from Jonathan Wakely --- Another place where I'd like to selectively enable warnings is for this code (from PR 78830): #include #include int main() { std::forward_list il = {1, 2, 3, 4, 5, 6, 7}; auto iter =

[Bug c++/80472] cannot use push/pop with #pragma GCC diagnostic warning "-Wsystem-headers"

2017-08-19 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80472 Manuel López-Ibáñez changed: What|Removed |Added Keywords||easyhack --- Comment #3 from

[Bug c++/80472] cannot use push/pop with #pragma GCC diagnostic warning "-Wsystem-headers"

2017-08-19 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80472 Manuel López-Ibáñez changed: What|Removed |Added CC||manu at gcc dot gnu.org ---

[Bug c++/80472] cannot use push/pop with #pragma GCC diagnostic warning "-Wsystem-headers"

2017-04-20 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80472 Marek Polacek changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|