Skip to content

Fix clang errors in 9on12Adapter.cpp#113

Merged
jenatali merged 1 commit into
microsoft:mainfrom
ruiji-shi:user/ruishi/d3d9on12-clang-adapter-fixes
Jun 13, 2026
Merged

Fix clang errors in 9on12Adapter.cpp#113
jenatali merged 1 commit into
microsoft:mainfrom
ruiji-shi:user/ruishi/d3d9on12-clang-adapter-fixes

Conversation

@ruiji-shi

Copy link
Copy Markdown
Contributor

Summary

Fixes three remaining Clang errors surfaced after the missing onecoreuap\windows\directx\dxg\inactive\d3d9\d3d9on12\linkdll\objfre\amd64\pch.clang.pch is dropped.

  • Fix where Clang refuses two chained user-defined conversions.
  • Fix -Waddress-of-temporary error

Validation:

Validated both MSVC and Clang build successfully.

Fixes three clang-cl errors surfaced when building under USE_CLANG=1, all in
Adapter::Adapter:

* CComQIPtr<T> p = pAdapterIUnknown -> pAdapterIUnknown.p (lines 234, 245)
  Clang refuses two chained user-defined conversions; using .p makes the
  IUnknown* conversion explicit.
* &m_pD3D12Device->GetAdapterLuid() -> stash LUID in a local first (line 261)
  Clang -Waddress-of-temporary; GetAdapterLuid() returns by value.

Byte-identical behavior on MSVC; validated against an OS enlistment by building
onecoreuap\windows\DirectX\dxg\inactive\d3d9\d3d9on12 under both USE_CLANG=1
and MSVC.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ruiji-shi ruiji-shi marked this pull request as ready for review June 11, 2026 22:51
@ruiji-shi ruiji-shi changed the title D3D9On12: fix clang errors in 9on12Adapter.cpp Fix clang errors in 9on12Adapter.cpp Jun 11, 2026
@jenatali jenatali merged commit 0e4a97f into microsoft:main Jun 13, 2026
1 of 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.

3 participants