Fix -Winvalid-token-paste Clang warnings#55
Merged
vdwtanner merged 1 commit intoMay 11, 2026
Conversation
Remove spurious '##' between '::' and the AbbreviatedView macro arg in ViewTraits specialization. The paste 'D3D12TranslationLayer::##AbbreviatedView' joined a punctuator '::' to an identifier 'SRV' (etc.), which produces two tokens ('::' and 'SRV'), not one.
Removing the '##' yields the same token stream the author wanted ('D3D12TranslationLayer :: SRV') and is now standards-conforming. The legitimate paste 'ID3D11##View' that builds 'ID3D11ShaderResourceView' is preserved.
Validated by building dxg/d3d11/D3D11On12/linkdll with bcz -clang in two parallel OS enlistments: baseline 14 errors (covers both this header and D3D12TranslationLayer/include/View.hpp) -> fix 0 errors.
vdwtanner
approved these changes
May 11, 2026
Contributor
|
Can ignore that PR build failure - environment issue in the host I haven't had a chance to fix |
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.
Summary
Remove a spurious
##between::and theAbbreviatedViewmacro argument in theViewTraitstemplate specialization. The expansionD3D12TranslationLayer::##AbbreviatedViewjoins a punctuator (::) to an identifier (SRV,RTV, …), which forms two tokens (::andSRV), not one — exactly what clang rejects under-Winvalid-token-paste.Removing the
##yields the byte-identical token stream the author intended (D3D12TranslationLayer :: SRV) and is now standards-conforming. The legitimate pasteID3D11##Viewthat buildsID3D11ShaderResourceViewis preserved.MSVC's traditional preprocessor silently dropped the broken paste, so the change has no behavioral impact on existing MSVC builds.
Errors fixed
include/view.hpp'::SRV','::RTV','::DSV','::UAV','::VDOV','::VPIV','::VPOV'Validation
Local build.