New warning (or at least I only noticed it now)

José Matos jaomatos at gmail.com
Mon Nov 21 21:07:02 UTC 2022


On Mon, 2022-11-21 at 14:07 +0100, Pavel Sanda wrote:
> 
> Maybe, I haven't study the code carefully. Can look again in the
> evening.
> 
> Pavel

OK, I send attached all the cases.
FWIW this is for an updating the code and the running make (I had
compiled yesterday, I think).

I hope that this helps,
-- 
José Abílio
-------------- next part --------------
/home/jamatos/lyx/lyx.anon/src/BufferView.cpp: In member function ‘bool lyx::BufferView::needsFitCursor() const’:
/home/jamatos/lyx/lyx.anon/src/BufferView.cpp:485:47: warning: possibly dangling reference to a temporary [-Wdangling-reference]
  485 |                 frontend::FontMetrics const & fm =
      |                                               ^~

/home/jamatos/lyx/lyx.anon/src/BufferView.cpp:486:39: note: the temporary was destroyed at the end of the full expression ‘lyx::theFontMetrics((*(const lyx::FontInfo*)(&((lyx::BufferView::Private*)((const lyx::BufferView*)this)->lyx::BufferView::d)->lyx::BufferView::Private::cursor_.lyx::Cursor::getFont().lyx::Font::fontInfo())))’
  486 |                         theFontMetrics(d->cursor_.getFont().fontInfo());
      |                         ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/home/jamatos/lyx/lyx.anon/src/Converter.cpp: In member function ‘lyx::Converters::RetVal lyx::Converters::convert(const lyx::Buffer*, const lyx::support::FileName&, const lyx::support::FileName&, const lyx::support::FileName&, const std::string&, const std::string&, lyx::ErrorList&, int, bool)’:
/home/jamatos/lyx/lyx.anon/src/Converter.cpp:714:55: warning: possibly dangling reference to a temporary [-Wdangling-reference]
  714 |                                         Mover const & mover = getMover(conv.to());
      |                                                       ^~~~~

/home/jamatos/lyx/lyx.anon/src/Converter.cpp:714:71: note: the temporary was destroyed at the end of the full expression ‘lyx::getMover(lyx::Converter::to() const())’
  714 |                                         Mover const & mover = getMover(conv.to());
      |                                                               ~~~~~~~~^~~~~~~~~~~

/home/jamatos/lyx/lyx.anon/src/Converter.cpp:786:39: warning: possibly dangling reference to a temporary [-Wdangling-reference]
  786 |                         Mover const & mover = getMover(conv.from());
      |                                       ^~~~~

/home/jamatos/lyx/lyx.anon/src/Converter.cpp:786:55: note: the temporary was destroyed at the end of the full expression ‘lyx::getMover(lyx::Converter::from() const())’
  786 |                         Mover const & mover = getMover(conv.from());
      |                                               ~~~~~~~~^~~~~~~~~~~~~

/home/jamatos/lyx/lyx.anon/src/CutAndPaste.cpp: In function ‘void lyx::cap::replaceSelectionWithString(lyx::Cursor&, const lyx::docstring&)’:
/home/jamatos/lyx/lyx.anon/src/CutAndPaste.cpp:1448:21: warning: possibly dangling reference to a temporary [-Wdangling-reference]
 1448 |         Paragraph & par = cur.selEnd().paragraph();
      |                     ^~~

/home/jamatos/lyx/lyx.anon/src/CutAndPaste.cpp:1448:49: note: the temporary was destroyed at the end of the full expression ‘(& cur)->lyx::Cursor::<anonymous>.lyx::CursorData::selEnd().lyx::CursorSlice::paragraph()’
 1448 |         Paragraph & par = cur.selEnd().paragraph();
|                           ~~~~~~~~~~~~~~~~~~~~~~^~

/home/jamatos/lyx/lyx.anon/src/ParagraphMetrics.cpp: In member function ‘int lyx::ParagraphMetrics::rightMargin(const lyx::BufferView&) const’:
/home/jamatos/lyx/lyx.anon/src/ParagraphMetrics.cpp:119:39: warning: possibly dangling reference to a temporary [-Wdangling-reference]
  119 |         frontend::FontMetrics const & fm = theFontMetrics(params.getFont());
      |                                       ^~

/home/jamatos/lyx/lyx.anon/src/ParagraphMetrics.cpp:119:58: note: the temporary was destroyed at the end of the full expression ‘lyx::theFontMetrics((& params)->lyx::BufferParams::getFont())’
  119 |         frontend::FontMetrics const & fm = theFontMetrics(params.getFont());
      |                                            ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~

/home/jamatos/lyx/lyx.anon/src/Text.cpp: In member function ‘const lyx::CompletionList* lyx::Text::createCompletionList(const lyx::Cursor&) const’:
/home/jamatos/lyx/lyx.anon/src/Text.cpp:2394:26: warning: possibly dangling reference to a temporary [-Wdangling-reference]
 2394 |         WordList const & list = theWordList(cur.getFont().language()->lang());
      |                          ^~~~
/home/jamatos/lyx/lyx.anon/src/Text.cpp:2394:44: note: the temporary was destroyed at the end of the full expression ‘lyx::theWordList(lyx::Language::lang() const())’
 2394 |         WordList const & list = theWordList(cur.getFont().language()->lang());
      |                                 ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/home/jamatos/lyx/lyx.anon/src/TextMetrics.cpp: In member function ‘int lyx::TextMetrics::labelFill(const lyx::Row&) const’:
/home/jamatos/lyx/lyx.anon/src/TextMetrics.cpp:782:29: warning: possibly dangling reference to a temporary [-Wdangling-reference]
  782 |         FontMetrics const & fm
      |                             ^~
/home/jamatos/lyx/lyx.anon/src/TextMetrics.cpp:783:33: note: the temporary was destroyed at the end of the full expression ‘lyx::theFontMetrics(((lyx::Text*)((const lyx::TextMetrics*)this)->lyx::TextMetrics::text_)->lyx::Text::labelFont((* & par)))’
  783 |                 = theFontMetrics(text_->labelFont(par));
      |                   ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~

/home/jamatos/lyx/lyx.anon/src/TextMetrics.cpp: In member function ‘lyx::Row lyx::TextMetrics::tokenizeParagraph(lyx::pit_type) const’:
/home/jamatos/lyx/lyx.anon/src/TextMetrics.cpp:898:45: warning: possibly dangling reference to a temporary [-Wdangling-reference]
  898 |                         FontMetrics const & fm = theFontMetrics(text_->labelFont(par));
      |                                             ^~
/home/jamatos/lyx/lyx.anon/src/TextMetrics.cpp:898:64: note: the temporary was destroyed at the end of the full expression ‘lyx::theFontMetrics(((lyx::Text*)((const lyx::TextMetrics*)this)->lyx::TextMetrics::text_)->lyx::Text::labelFont((* & par)))’
  898 |                         FontMetrics const & fm = theFontMetrics(text_->labelFont(par));
      |                                                  ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/home/jamatos/lyx/lyx.anon/src/TextMetrics.cpp: In member function ‘int lyx::TextMetrics::leftMargin(lyx::pit_type, lyx::pos_type) const’:
/home/jamatos/lyx/lyx.anon/src/TextMetrics.cpp:1753:29: warning: possibly dangling reference to a temporary [-Wdangling-reference]
 1753 |         FontMetrics const & bfm = theFontMetrics(buffer.params().getFont());
      |                             ^~~
/home/jamatos/lyx/lyx.anon/src/TextMetrics.cpp:1753:49: note: the temporary was destroyed at the end of the full expression ‘lyx::theFontMetrics((&(& buffer)->lyx::Buffer::params())->lyx::BufferParams::getFont())’
 1753 |         FontMetrics const & bfm = theFontMetrics(buffer.params().getFont());
      |                                   ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~

/home/jamatos/lyx/lyx.anon/src/insets/InsetGraphics.cpp: In function ‘const std::pair<lyx::{anonymous}::GraphicsCopyStatus, lyx::support::FileName> lyx::{anonymous}::copyFileIfNeeded(const lyx::support::FileName&, const lyx::support::FileName&)’:
/home/jamatos/lyx/lyx.anon/src/insets/InsetGraphics.cpp:558:23: warning: possibly dangling reference to a temporary [-Wdangling-reference]
  558 |         Mover const & mover = getMover(theFormats().getFormatFromFile(file_in));
      |                       ^~~~~
/home/jamatos/lyx/lyx.anon/src/insets/InsetGraphics.cpp:558:39: note: the temporary was destroyed at the end of the full expression ‘lyx::getMover(lyx::Formats::getFormatFromFile(const lyx::support::FileName&) const((* & file_in)))’
  558 |         Mover const & mover = getMover(theFormats().getFormatFromFile(file_in));
      |                               ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


More information about the lyx-devel mailing list