forked from qt-creator/qt-creator
Fix dangling references, found by GCC 13
Lifetime extension via const-ref only applies to functions that return by value. For those that already return by reference (such as QList::constLast()), no extension happens and we end up with a dangling reference. cmakebuildconfiguration.cpp:1473:25: warning: possibly dangling reference to a temporary [-Wdangling-reference] cmakebuildconfiguration.cpp:1473:61: note: the temporary was destroyed at the end of the full expression ‘ProjectExplorer::BuildStepList::steps() const().QList<ProjectExplorer::BuildStep*>::constLast()’ Change-Id: I3b169860d8bd41e9be6bfffd1757167b7348be9b Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
This commit is contained in:
@@ -2905,9 +2905,9 @@ void TextEditorWidget::insertCodeSnippet(const QTextCursor &cursor_arg,
|
||||
d->m_document->autoIndent(cursor);
|
||||
cursor.endEditBlock();
|
||||
|
||||
const QColor &occurrencesColor
|
||||
const QColor occurrencesColor
|
||||
= textDocument()->fontSettings().toTextCharFormat(C_OCCURRENCES).background().color();
|
||||
const QColor &renameColor
|
||||
const QColor renameColor
|
||||
= textDocument()->fontSettings().toTextCharFormat(C_OCCURRENCES_RENAME).background().color();
|
||||
|
||||
for (const CursorPart &part : cursorParts) {
|
||||
|
||||
Reference in New Issue
Block a user