Result.setIsUnsigned(!getType()->isSignedIntegerType());
break;
}
+ case CXXBoolLiteralExprClass: {
+ const CXXBoolLiteralExpr *BL = cast<CXXBoolLiteralExpr>(this);
+ Result.zextOrTrunc(static_cast<uint32_t>(Ctx.getTypeSize(getType())));
+ Result = BL->getValue();
+ Result.setIsUnsigned(!getType()->isSignedIntegerType());
+ break;
+ }
case CXXZeroInitValueExprClass:
Result.clear();
break;
--- /dev/null
+// RUN: clang -fsyntax-only -verify %s
+
+// Bool literals can be enum values.
+enum {
+ ReadWrite = false,
+ ReadOnly = true
+};