[Bug c++/105470] ranged for loop whitespace parsing

2022-05-04 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105470 --- Comment #12 from Jonathan Wakely --- (In reply to Roland Hughes from comment #10) > There is no definition of that map anywhere in the codebase where > KeyModifiers is declared const. That's just how std::map works. std::map::value_type is

[Bug c++/105470] ranged for loop whitespace parsing

2022-05-04 Thread roland at logikalsolutions dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105470 --- Comment #11 from Roland Hughes --- (In reply to Marek Polacek from comment #9) > (In reply to Roland Hughes from comment #8) > > (In reply to Marek Polacek from comment #1) > > > Can you please provide a stand-alone test case? > > > > I wil

[Bug c++/105470] ranged for loop whitespace parsing

2022-05-04 Thread roland at logikalsolutions dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105470 --- Comment #10 from Roland Hughes --- (In reply to Marek Polacek from comment #1) > > The warning is completely correct, and the code should be fixed. > > for ( const std::pair &it : someMap ) > > This iterates over a map, with values of typ

[Bug c++/105470] ranged for loop whitespace parsing

2022-05-04 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105470 --- Comment #9 from Marek Polacek --- (In reply to Roland Hughes from comment #8) > (In reply to Marek Polacek from comment #1) > > Can you please provide a stand-alone test case? > > I will work on this over the weekend. Looks like that's not

[Bug c++/105470] ranged for loop whitespace parsing

2022-05-04 Thread roland at logikalsolutions dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105470 --- Comment #8 from Roland Hughes --- (In reply to Marek Polacek from comment #1) > Can you please provide a stand-alone test case? I will work on this over the weekend.

[Bug c++/105470] ranged for loop whitespace parsing

2022-05-04 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105470 --- Comment #7 from Jonathan Wakely --- Yes, or use TheMapType::const_iterator. If you're going to name the type explicitly, you need to be sure to use the correct type.

[Bug c++/105470] ranged for loop whitespace parsing

2022-05-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105470 --- Comment #6 from Andrew Pinski --- (In reply to Jonathan Wakely from comment #5) > GCC even tells you exactly how to fix the code. > > Here's the GCC error reformatted to make it a bit easier to read: > > error: loop variable it of type > c

[Bug c++/105470] ranged for loop whitespace parsing

2022-05-03 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105470 --- Comment #5 from Jonathan Wakely --- GCC even tells you exactly how to fix the code. Here's the GCC error reformatted to make it a bit easier to read: error: loop variable it of type const std::pair& binds to a temporary constructed from ty

[Bug c++/105470] ranged for loop whitespace parsing

2022-05-03 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105470 Jonathan Wakely changed: What|Removed |Added Status|WAITING |RESOLVED Resolution|---

[Bug c++/105470] ranged for loop whitespace parsing

2022-05-03 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105470 --- Comment #3 from Jonathan Wakely --- It looks more like you're using -Werror and a new warning in the new GCC is being turned into an error, because you asked for it.

[Bug c++/105470] ranged for loop whitespace parsing

2022-05-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105470 Andrew Pinski changed: What|Removed |Added Last reconfirmed||2022-05-03 Status|UNCONFIRM

[Bug c++/105470] ranged for loop whitespace parsing

2022-05-03 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105470 Marek Polacek changed: What|Removed |Added CC||mpolacek at gcc dot gnu.org --- Comment