Re: Shadowing declarations

Jean-Marc Lasgouttes <[email protected]>
Newsgroups gmane.editors.lyx.devel
Message-ID <[email protected]>
Le 20/02/2026 à 11:40, Jürgen Spitzmüller a écrit :
> I went through the warnings raised by CXXFLAGS=-Wshadow and fixed most
> of them. Most are really straightforward but I'd like to have some
> double-checking before I commit.
> 
> Also, there are three I didn't dare to touch. (1.) is probably for
> JMarc, (2.) and (3.) for Thibaut:

Let me be clear : I do Row and MathRow, but do no touch TexRow. I have 
my principles ;)

Nevertheless, I renamed the parameter (renaming the local variable was 
more complicated).

JMarc

> 
> (1.)
> 
> Buffer.cpp: In member function 'void
> lyx::Buffer::Impl::traverseErrors(std::vector<lyx::TeXErrors::Error>::c
> onst_iterator, std::vector<lyx::TeXErrors::Error>::const_iterator,
> lyx::ErrorList&) const':
> Buffer.cpp:5050:62: warning: declaration of 'lyx::TexRow::TextEntry
> end' shadows a parameter [-Wshadow]
>   5050 |                 TexRow::TextEntry start = TexRow::text_none,
> end = TexRow::text_none;
>        |
> ^~~
> Buffer.cpp:5047:108: note: shadowed declaration is here
>   5047 | void
> Buffer::Impl::traverseErrors(TeXErrors::Errors::const_iterator err,
> TeXErrors::Errors::const_iterator end, ErrorList & errorList) const
>        |
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
-- 
lyx-devel mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.