[cfe-commits] r139334 - in /cfe/trunk: lib/Sema/SemaChecking.cpp test/SemaObjC/enum-fixed-type.m
Douglas Gregor
dgregor at apple.com
Thu Sep 8 16:29:05 PDT 2011
Author: dgregor
Date: Thu Sep 8 18:29:05 2011
New Revision: 139334
URL: http://llvm.org/viewvc/llvm-project?rev=139334&view=rev
Log:
The integer type of an enumeration type isn't always canonical
Modified:
cfe/trunk/lib/Sema/SemaChecking.cpp
cfe/trunk/test/SemaObjC/enum-fixed-type.m
Modified: cfe/trunk/lib/Sema/SemaChecking.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaChecking.cpp?rev=139334&r1=139333&r2=139334&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaChecking.cpp (original)
+++ cfe/trunk/lib/Sema/SemaChecking.cpp Thu Sep 8 18:29:05 2011
@@ -2597,7 +2597,7 @@
if (const ComplexType *CT = dyn_cast<ComplexType>(T))
T = CT->getElementType().getTypePtr();
if (const EnumType *ET = dyn_cast<EnumType>(T))
- T = ET->getDecl()->getIntegerType().getTypePtr();
+ T = C.getCanonicalType(ET->getDecl()->getIntegerType()).getTypePtr();
const BuiltinType *BT = cast<BuiltinType>(T);
assert(BT->isInteger());
Modified: cfe/trunk/test/SemaObjC/enum-fixed-type.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/enum-fixed-type.m?rev=139334&r1=139333&r2=139334&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/enum-fixed-type.m (original)
+++ cfe/trunk/test/SemaObjC/enum-fixed-type.m Thu Sep 8 18:29:05 2011
@@ -20,3 +20,8 @@
enum Other : Integer field3 : 4;
enum : Integer { Blah, Blarg } field4 : 4;
};
+
+void test() {
+ long value = 2;
+ Enumeration e = value;
+}
More information about the cfe-commits
mailing list