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 MSVC 14.1 complaining about "attempting to reference a deleted function" in RenderPassClearValue #86507

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

jsjtxietian
Copy link
Contributor

Fixes #86443

We could also add something like new (&color) Color() inside the ctor, but it doesn't seems very necessary.

@jsjtxietian jsjtxietian requested a review from a team as a code owner December 25, 2023 10:51
@jsjtxietian jsjtxietian changed the title Fix msvc 14.1 complains about "atempting to reference a deleted function" Fix msvc 14.1 complains about "atempting to reference a deleted function" in RenderPassClearValue Dec 25, 2023
Copy link
Member

@RandomShaper RandomShaper left a comment

Choose a reason for hiding this comment

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

What does it happen if instead of that change, the initializer is removed from Color, that, after all, zero-initializes internally?

@jsjtxietian
Copy link
Contributor Author

zero-initializes internally

@RandomShaper Sorry I don't quite understand, where do we put the zero-initializes? In the constructor?

image

https://godbolt.org/z/5qGvGcof8

@clayjohn
Copy link
Member

clayjohn commented Jan 6, 2024

What does it happen if instead of that change, the initializer is removed from Color, that, after all, zero-initializes internally?

@RandomShaper Still doesn't work because Color doesn't have a trivial constructor (at least that's what the error message says)

Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

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

Seems fine to me. @RandomShaper should have a chance to take another look before merging

@akien-mga akien-mga changed the title Fix msvc 14.1 complains about "atempting to reference a deleted function" in RenderPassClearValue Fix MSVC 14.1 complaining about "attempting to reference a deleted function" in RenderPassClearValue Jan 8, 2024
Copy link
Member

@RandomShaper RandomShaper left a comment

Choose a reason for hiding this comment

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

Oh, I see. The compiler deletes the constructor to be safe, so an explicit constructor is needed. Makes sense! My only (soft) suggestion now would be to use the = default syntax, but I'm fine with either.

@jsjtxietian
Copy link
Contributor Author

My only (soft) suggestion now would be to use the = default syntax, but I'm fine with either.

lol that won't work too. see https://godbolt.org/z/TY34Ph54G

So I guess it should stay as it is now

@akien-mga akien-mga merged commit 5ac5be4 into godotengine:master Jan 8, 2024
15 checks passed
@akien-mga
Copy link
Member

Thanks!

@jsjtxietian jsjtxietian deleted the fix-msvc-2017 branch January 8, 2024 11:19
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.

Build failing in MSVC 2017
5 participants