from a patch by Justin Bogner.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192671
91177308-0d34-0410-b5e6-
96231b3b80d8
//===----------------------------------------------------------------------===//
unsigned ASTContext::getIntWidth(QualType T) const {
- if (const EnumType *ET = dyn_cast<EnumType>(T))
+ if (const EnumType *ET = T->getAs<EnumType>())
T = ET->getDecl()->getIntegerType();
if (T->isBooleanType())
return 1;
enum class A;
A f(A a) { return -a; } // expected-error {{invalid argument type 'PR16900::A' to unary expression}}
}
+
+namespace rdar15124329 {
+ enum class B : bool { F, T };
+
+ const rdar15124329::B T1 = B::T;
+ typedef B C; const C T2 = B::T;
+
+ static_assert(T1 != B::F, "");
+ static_assert(T2 == B::T, "");
+}
+