From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7461E3858D3C; Tue, 3 May 2022 23:28:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7461E3858D3C From: "roland at logikalsolutions dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/105470] New: ranged for loop whitespace parsing Date: Tue, 03 May 2022 23:28:23 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: roland at logikalsolutions dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 May 2022 23:28:23 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105470 Bug ID: 105470 Summary: ranged for loop whitespace parsing Product: gcc Version: 11.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: roland at logikalsolutions dot com Target Milestone: --- I have this library=20 https://sourceforge.net/u/roland_hughes/csscintilla/ci/default/tree/ On Ubuntu 20.04 it builds clean. roland@roland-HP-EliteDesk-800-G2-SFF:/$ gcc --version gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0 Copyright (C) 2019 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. On Ubuntu 22.04 it does not. roland@roland-u22-04-VirtualBox:~/sf_projects/roland_hughes-csscintilla/cop= perspice$ gcc --version gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0 Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Fresh build directory established [37/39] Building CXX object src/CMakeFiles/CsScintilla.dir/__/CsScintillaEditBase/CsScintillaEditBase.c= pp.o FAILED: src/CMakeFiles/CsScintilla.dir/__/CsScintillaEditBase/CsScintillaEditBase.c= pp.o=20 /usr/bin/c++ -DBUILD_DATE=3D\"05/03/2022\" -DCsScintilla_EXPORTS -I/home/roland/sf_projects/csscintilla_build/src -I/home/roland/sf_projects/roland_hughes-csscintilla/copperspice/src -I/home/roland/sf_projects/roland_hughes-csscintilla/copperspice/../include -I/home/roland/sf_projects/roland_hughes-csscintilla/copperspice/../src -I/home/roland/sf_projects/roland_hughes-csscintilla/copperspice/CsScintill= aEditBase -I/home/roland/sf_projects/roland_hughes-csscintilla/copperspice/CsScintill= aEdit -isystem /usr/lib/cs_lib/include -isystem /usr/lib/cs_lib/include/QtCore -isystem /usr/lib/cs_lib/include/QtGui -O3 -DNDEBUG -fPIC -DSCINTILLA_CS -DMAKING_LIBRARY=3D1 -DSCI_LEXER=3D1 -D_CRT_SECURE_NO_DEPRECATE=3D1 -DNDEBU= G=3D1 -Wall -Wextra -Wuninitialized -pedantic -Werror -std=3Dgnu++17 -MD -MT src/CMakeFiles/CsScintilla.dir/__/CsScintillaEditBase/CsScintillaEditBase.c= pp.o -MF src/CMakeFiles/CsScintilla.dir/__/CsScintillaEditBase/CsScintillaEditBase.c= pp.o.d -o src/CMakeFiles/CsScintilla.dir/__/CsScintillaEditBase/CsScintillaEditBase.c= pp.o -c /home/roland/sf_projects/roland_hughes-csscintilla/copperspice/CsScintillaE= ditBase/CsScintillaEditBase.cpp /home/roland/sf_projects/roland_hughes-csscintilla/copperspice/CsScintillaE= ditBase/CsScintillaEditBase.cpp: In member function QString CsScintillaEditBase::keyMapText(int): /home/roland/sf_projects/roland_hughes-csscintilla/copperspice/CsScintillaE= ditBase/CsScintillaEditBase.cpp:1034:62: error: loop variable it of type const std::pair& binds to a temporary constructed from type const std::pair [-Werror=3Drange-loop-construct] 1034 | for ( const std::pair &it : sqt->kmap.GetKeyMap() ) | ^~ /home/roland/sf_projects/roland_hughes-csscintilla/copperspice/CsScintillaE= ditBase/CsScintillaEditBase.cpp:1034:62: note: use non-reference type const std::pair to make the copy explicit or const std::pair& to prevent copying cc1plus: all warnings being treated as errors ninja: build stopped: subcommand failed. If you look at the error message, this version of the compiler demands the = & be against > instead of out with the variable. This appears to be a whitespace parsing bug.=