From 97acf5fdfc81c3ba697436c8fe774a34cb70d046 Mon Sep 17 00:00:00 2001 From: kchristin Date: Sat, 3 Aug 2024 12:15:29 +0300 Subject: [PATCH] Get enum's underlying value type --- lib/Differentiator/CladUtils.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Differentiator/CladUtils.cpp b/lib/Differentiator/CladUtils.cpp index 3b6a379e0..d0ff345ed 100644 --- a/lib/Differentiator/CladUtils.cpp +++ b/lib/Differentiator/CladUtils.cpp @@ -372,6 +372,10 @@ namespace clad { else if (T->isArrayType()) valueType = T->getPointeeOrArrayElementType()->getCanonicalTypeInternal(); + else if (T->isEnumeralType()){ + if (const auto* ET = dyn_cast(T)) + valueType = ET->getDecl()->getIntegerType(); + } valueType.removeLocalConst(); return valueType; }