From: Fariborz Jahanian Date: Mon, 15 Sep 2014 16:41:47 +0000 (+0000) Subject: Objective-C SDK modernizer. Do not modernize an enum X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=57129e595a4d48191e1d43bc56c7bd19300cb4c2;p=clang Objective-C SDK modernizer. Do not modernize an enum which already has the underlying interger type specification. // rdar://1826225 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217783 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/ARCMigrate/ObjCMT.cpp b/lib/ARCMigrate/ObjCMT.cpp index fe2fd6165d..78dbd87a05 100644 --- a/lib/ARCMigrate/ObjCMT.cpp +++ b/lib/ARCMigrate/ObjCMT.cpp @@ -760,7 +760,7 @@ bool ObjCMigrateASTConsumer::migrateNSEnumDecl(ASTContext &Ctx, const EnumDecl *EnumDcl, const TypedefDecl *TypedefDcl) { if (!EnumDcl->isCompleteDefinition() || EnumDcl->getIdentifier() || - EnumDcl->isDeprecated()) + EnumDcl->isDeprecated() || EnumDcl->getIntegerTypeSourceInfo()) return false; if (!TypedefDcl) { if (NSIntegerTypedefed) { diff --git a/test/ARCMT/objcmt-ns-macros.m b/test/ARCMT/objcmt-ns-macros.m index 1bf55d8ed4..851c490758 100644 --- a/test/ARCMT/objcmt-ns-macros.m +++ b/test/ARCMT/objcmt-ns-macros.m @@ -294,3 +294,11 @@ enum { NSWindowToolbarButton, NSWindowDocumentIconButton }; + +// rdar://18262255 +typedef enum : NSUInteger { + ThingOne, + ThingTwo, + ThingThree, +} Thing; + diff --git a/test/ARCMT/objcmt-ns-macros.m.result b/test/ARCMT/objcmt-ns-macros.m.result index 0b640ac356..003b3c7f2a 100644 --- a/test/ARCMT/objcmt-ns-macros.m.result +++ b/test/ARCMT/objcmt-ns-macros.m.result @@ -277,3 +277,11 @@ typedef NS_ENUM(NSUInteger, NSSelectionDirection) { }; // standard window buttons + +// rdar://18262255 +typedef enum : NSUInteger { + ThingOne, + ThingTwo, + ThingThree, +} Thing; +