Skip to content

Clang address of temporary in DerivedVertex#111

Merged
jenatali merged 1 commit into
microsoft:mainfrom
ruiji-shi:user/ruishi/clang-address-of-temporary
Jun 3, 2026
Merged

Clang address of temporary in DerivedVertex#111
jenatali merged 1 commit into
microsoft:mainfrom
ruiji-shi:user/ruishi/clang-address-of-temporary

Conversation

@ruiji-shi

@ruiji-shi ruiji-shi commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary

InputLayout::GetHash() returns WeakHash by value, so &inputLayout.GetHash() takes the address of a prvalue temporary. Clang rejects this with -Waddress-of-temporary (errors by default).

Decided to fix this since this is the only AOT issue in this repo.

…ShaderKey

InputLayout::GetHash() returns WeakHash by value. Passing &inputLayout.GetHash() to memcpy takes the address of a temporary, which clang rejects with -Waddress-of-temporary (treated as an error). Bind the temporary to a named local so memcpy receives a real lvalue address. MSVC behavior is unchanged.
@ruiji-shi ruiji-shi marked this pull request as ready for review June 3, 2026 17:04
@jenatali jenatali merged commit 98696ba into microsoft:main Jun 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants