Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation on gcc13 #78345

Merged
merged 1 commit into from
Jun 16, 2023
Merged

Conversation

groud
Copy link
Member

@groud groud commented Jun 16, 2023

Fixes compilation on gcc13. Wihtout it, it would not compile with this scons command: scons platform=linuxbsd verbose=yes target=editor dev_build=yes -j4 warnings=extra werror=yes

The error was:

editor/editor_inspector.cpp: In member function 'void EditorInspector::_edit_set(const String&, const Variant&, bool, const String&)':
editor/editor_inspector.cpp:3694:41: error: possibly dangling reference to a temporary [-Werror=dangling-reference]
 3694 |                         const Callable &callback = EditorNode::get_singleton()->get_editor_data().get_undo_redo_inspector_hook_callback()[i];
      |                                         ^~~~~~~~
editor/editor_inspector.cpp:3694:140: note: the temporary was destroyed at the end of the full expression 'EditorData::get_undo_redo_inspector_hook_callback()().Vector<Callable>::operator[](i)'
 3694 |                         const Callable &callback = EditorNode::get_singleton()->get_editor_data().get_undo_redo_inspector_hook_callback()[i];
      |   

This PR seems to have fixed it on my computer.

@groud groud added this to the 4.x milestone Jun 16, 2023
Copy link
Member

@adamscott adamscott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@akien-mga akien-mga modified the milestones: 4.x, 4.1 Jun 16, 2023
@akien-mga akien-mga merged commit fa268be into godotengine:master Jun 16, 2023
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

Cherry-picked for 4.0.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants