Skip to content

Commit a660f45

Browse files
committed
making extractEnumValue stricter
1 parent 3b35627 commit a660f45

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

llvm/lib/Frontend/HLSL/RootSignatureMetadata.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ static std::optional<StringRef> extractMdStringValue(MDNode *Node,
5252
return NodeText->getString();
5353
}
5454

55-
template <typename T, std::enable_if_t<std::is_enum_v<T>, int> = 0>
55+
template <typename T, typename = std::enable_if_t<
56+
std::is_enum_v<T> &&
57+
std::is_same_v<std::underlying_type_t<T>, uint32_t>>>
5658
Expected<T> extractEnumValue(MDNode *Node, unsigned int OpId, StringRef ErrText,
5759
llvm::function_ref<bool(uint32_t)> VerifyFn) {
5860
if (std::optional<uint32_t> Val = extractMdIntValue(Node, OpId)) {

0 commit comments

Comments
 (0)