Add documentation about boxing enum types and a codegen test to make
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
diff --git a/docs/ObjectiveCLiterals.html b/docs/ObjectiveCLiterals.html
index ca7704d..33f73e4 100644
--- a/docs/ObjectiveCLiterals.html
+++ b/docs/ObjectiveCLiterals.html
@@ -157,6 +157,18 @@
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>