sure we pick up the underlying type, per suggestion by Fariborz.
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156851
91177308-0d34-0410-b5e6-
96231b3b80d8
then the fixed underlying type will be used to select the correct <code>NSNumber</code> creation method.
</p>
+<p>
+Boxing a value of enum type will result in a <code>NSNumber</code> pointer with a creation method according to the underlying type of the enum,
+which can be a <a href="http://clang.llvm.org/docs/LanguageExtensions.html#objc_fixed_enum">fixed underlying type</a> or a compiler-defined
+integer type capable of representing the values of all the members of the enumeration:
+</p>
+
+<pre>
+typedef enum : unsigned char { Red, Green, Blue } Color;
+Color col = Red;
+NSNumber *nsCol = @(col); // => [NSNumber numberWithUnsignedChar:]
+</pre>
+
<h3>Boxed C Strings</h3>
<p>
@((NSUInteger)i);
// CHECK: load i8** [[stringWithUTF8StringSEL]]
const char *s; @(s);
+
+ typedef enum : NSInteger { Red, Green, Blue } Color;
+ // CHECK: load i8** [[WithIntegerSEL]]
+ @(Red);
+ Color col = Red;
+ // CHECK: load i8** [[WithIntegerSEL]]
+ @(col);
}