Skip to content

Commit

Permalink
Get enum's underlying value type
Browse files Browse the repository at this point in the history
  • Loading branch information
kchristin22 authored and vgvassilev committed Aug 7, 2024
1 parent 1f4e2a3 commit 97acf5f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/Differentiator/CladUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,10 @@ namespace clad {
else if (T->isArrayType())
valueType =
T->getPointeeOrArrayElementType()->getCanonicalTypeInternal();
else if (T->isEnumeralType()){
if (const auto* ET = dyn_cast<EnumType>(T))
valueType = ET->getDecl()->getIntegerType();
}
valueType.removeLocalConst();
return valueType;
}
Expand Down

0 comments on commit 97acf5f

Please sign in to comment.