Add a clang-tidy CI job for Windows-only code and fix issues - #3225
Open
bradgrantham-lunarg wants to merge 1 commit into
Open
bradgrantham-lunarg wants to merge 1 commit into
bradgrantham-lunarg wants to merge 1 commit into
Conversation
bradgrantham-lunarg
marked this pull request as draft
August 26, 2026 19:18
bradgrantham-lunarg
force-pushed
the
add-clang-tidy-windows
branch
from
August 26, 2026 19:18
fd8eec3 to
0b9a314
Compare
The existing clang-tidy job runs on Linux, so code guarded by Windows
macros (WIN32, VK_USE_PLATFORM_WIN32_KHR, D3D12_SUPPORT,
GFXRECON_AGS_SUPPORT, ...) is never analyzed. Add a clang-tidy-windows
job that configures with Ninja + clang-cl (D3D12 enabled) and runs
run-clang-tidy over just the guarded sources, using a new
.github/scripts/guarded_sources.py helper to enumerate the .cpp files
and build the -header-filter regex from the guarded headers.
These issues compile with MSVC but are rejected by clang-cl, and were
found by the new clang-tidy-windows CI job:
- generated_dx12_add_entries.h declared AddEntry parameters as
'typename void**'; 'typename' is not valid there ('expected a
qualified name after typename'). Remove it from the generator and
mirror the change in the checked-in generated header.
- Dx12ReplayConsumerBase::ApplyBatchedResourceInitInfo passed a
std::string through GFXRECON_LOG_WARNING's varargs, which is
undefined behavior; format it with .c_str() like other call sites.
- Dx12StateTracker::AddEntry declared its handle parameters as
'typename void**'; remove the invalid 'typename', matching the fix in
generated_dx12_add_entries.h.
- TrackPresentedImages used 'sizeof RECT' without parentheses, which is
an MSVC extension; standard C++ requires 'sizeof(RECT)' for a type
operand.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014kFLeTDqXuNRbDjMw42C4q
bradgrantham-lunarg
force-pushed
the
add-clang-tidy-windows
branch
from
September 15, 2026 20:40
0b9a314 to
c3a8b31
Compare
bradgrantham-lunarg
marked this pull request as ready for review
September 15, 2026 20:44
bradgrantham-lunarg
requested review from
davidd-lunarg and
mikes-lunarg
and removed request for
davidd-lunarg
September 18, 2026 19:53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The existing clang-tidy job runs on Linux, so code guarded by Windows macros (WIN32, VK_USE_PLATFORM_WIN32_KHR, D3D12_SUPPORT, GFXRECON_AGS_SUPPORT, ...) is never analyzed. Add a clang-tidy-windows job that configures with Ninja + clang-cl (D3D12 enabled) and runs run-clang-tidy over just the guarded sources, using a new .github/scripts/guarded_sources.py helper to enumerate the .cpp files and build the -header-filter regex from the guarded headers.
These issues compile with MSVC but are rejected by clang-cl, and were found by the new clang-tidy-windows CI job:
generated_dx12_add_entries.h declared AddEntry parameters as 'typename void**'; 'typename' is not valid there ('expected a qualified name after typename'). Remove it from the generator and mirror the change in the checked-in generated header.
Dx12ReplayConsumerBase::ApplyBatchedResourceInitInfo passed a std::string through GFXRECON_LOG_WARNING's varargs, which is undefined behavior; format it with .c_str() like other call sites.
Dx12StateTracker::AddEntry declared its handle parameters as 'typename void**'; remove the invalid 'typename', matching the fix in generated_dx12_add_entries.h.
TrackPresentedImages used 'sizeof RECT' without parentheses, which is an MSVC extension; standard C++ requires 'sizeof(RECT)' for a type operand.