We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7417b4c commit 1cdf1e6Copy full SHA for 1cdf1e6
clang/lib/AST/Interp/Context.cpp
@@ -135,6 +135,9 @@ std::optional<PrimType> Context::classify(QualType T) const {
135
if (T->isAnyComplexType() || T->isVectorType())
136
return std::nullopt;
137
138
+ if (const auto *ET = T->getAs<EnumType>())
139
+ return classify(ET->getDecl()->getIntegerType());
140
+
141
if (T->isSignedIntegerOrEnumerationType()) {
142
switch (Ctx.getIntWidth(T)) {
143
case 64:
clang/test/AST/Interp/enums.cpp
@@ -48,3 +48,8 @@ constexpr EC getB() {
48
49
50
static_assert(getB() == EC::B, "");
51
52
+namespace B {
53
+ enum E : bool { Zero, One };
54
+ static_assert((int)(E)2 == 1, "");
55
+} // namespace B
0 commit comments