public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/105470] New: ranged for loop whitespace parsing
@ 2022-05-03 23:28 roland at logikalsolutions dot com
  2022-05-03 23:41 ` [Bug c++/105470] " mpolacek at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: roland at logikalsolutions dot com @ 2022-05-03 23:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105470

            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 

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/copperspice$
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.cpp.o
FAILED:
src/CMakeFiles/CsScintilla.dir/__/CsScintillaEditBase/CsScintillaEditBase.cpp.o 
/usr/bin/c++ -DBUILD_DATE=\"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/CsScintillaEditBase
-I/home/roland/sf_projects/roland_hughes-csscintilla/copperspice/CsScintillaEdit
-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=1 -DSCI_LEXER=1 -D_CRT_SECURE_NO_DEPRECATE=1 -DNDEBUG=1 -Wall
-Wextra -Wuninitialized -pedantic -Werror -std=gnu++17 -MD -MT
src/CMakeFiles/CsScintilla.dir/__/CsScintillaEditBase/CsScintillaEditBase.cpp.o
-MF
src/CMakeFiles/CsScintilla.dir/__/CsScintillaEditBase/CsScintillaEditBase.cpp.o.d
-o
src/CMakeFiles/CsScintilla.dir/__/CsScintillaEditBase/CsScintillaEditBase.cpp.o
-c
/home/roland/sf_projects/roland_hughes-csscintilla/copperspice/CsScintillaEditBase/CsScintillaEditBase.cpp
/home/roland/sf_projects/roland_hughes-csscintilla/copperspice/CsScintillaEditBase/CsScintillaEditBase.cpp:
In member function QString CsScintillaEditBase::keyMapText(int):
/home/roland/sf_projects/roland_hughes-csscintilla/copperspice/CsScintillaEditBase/CsScintillaEditBase.cpp:1034:62:
error: loop variable it of type const
std::pair<Scintilla::Internal::KeyModifiers, Scintilla::Message>& binds to a
temporary constructed from type const std::pair<const
Scintilla::Internal::KeyModifiers, Scintilla::Message>
[-Werror=range-loop-construct]
 1034 |     for ( const std::pair<KeyModifiers, Scintilla::Message> &it :
sqt->kmap.GetKeyMap() )
      |                                                              ^~
/home/roland/sf_projects/roland_hughes-csscintilla/copperspice/CsScintillaEditBase/CsScintillaEditBase.cpp:1034:62:
note: use non-reference type const
std::pair<Scintilla::Internal::KeyModifiers, Scintilla::Message> to make the
copy explicit or const std::pair<const Scintilla::Internal::KeyModifiers,
Scintilla::Message>& 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.

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-05-04 15:31 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-03 23:28 [Bug c++/105470] New: ranged for loop whitespace parsing roland at logikalsolutions dot com
2022-05-03 23:41 ` [Bug c++/105470] " mpolacek at gcc dot gnu.org
2022-05-03 23:49 ` pinskia at gcc dot gnu.org
2022-05-04  0:14 ` redi at gcc dot gnu.org
2022-05-04  0:18 ` redi at gcc dot gnu.org
2022-05-04  0:21 ` redi at gcc dot gnu.org
2022-05-04  0:32 ` pinskia at gcc dot gnu.org
2022-05-04  8:07 ` redi at gcc dot gnu.org
2022-05-04 14:33 ` roland at logikalsolutions dot com
2022-05-04 14:39 ` mpolacek at gcc dot gnu.org
2022-05-04 14:40 ` roland at logikalsolutions dot com
2022-05-04 14:43 ` roland at logikalsolutions dot com
2022-05-04 15:31 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).