Fix: no-enum-constexpr-conversion compilation error of DX12 backend with clang-cl#696
Merged
TheMostDiligent merged 2 commits intoDiligentGraphics:masterfrom Aug 14, 2025
Merged
Conversation
…ith clang-cl The warning suppression -Wno-enum-constexpr-conversion no longer works on recent Clang versions because the warning it used to suppress has been promoted to an error that cannot be disabled (see llvm/llvm-project#59036). Also, the previous error in RootParamsManager.cpp was due to converting -1 to a D3D12_DESCRIPTOR_RANGE_TYPE enum in a constexpr context. Clang rejects this, but it allows the conversion for a regular const. The code has been updated to use a const instead of constexpr, making the conversion valid. Since the original issue that motivated the warning suppression no longer applies, we can safely remove -Wno-enum-constexpr-conversion.
c4a98bd
into
DiligentGraphics:master
37 of 38 checks passed
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
This PR removes the
-Wno-enum-constexpr-conversioncompiler flag fromthe D3D12 graphics engine build. The original warning suppression is no
longer necessary because:
Clang now treats the conversion from an invalid enum value in a
constexpr context as an error that cannot be suppressed
(-Wenum-constexpr-conversion should be a hard error, not a downgradable error llvm/llvm-project#59036).
The code in
RootParamsManager.cpphas been updated: theInvalidDescriptorRangeTypeis now aconstinstead ofconstexpr,making the conversion from
-1valid.Changes
-Wno-enum-constexpr-conversionfrom Clang compile options.InvalidDescriptorRangeTypefromconstexprtoconst.This makes the code compatible with newer Clang versions and removes
unnecessary warning suppressions.