Add a comment about MOZ_BEGIN_ENUM_CLASS/MOZ_END_ENUM_CLASS to say that they should not be used for nested enums, no bug
authorEhsan Akhgari <ehsan@mozilla.com>
Fri, 26 Oct 2012 13:56:54 -0400
changeset 111679 fa8b3e203cf055442855754491a0a8ae3970bad1
parent 111678 e5ac0909f0578dafea58669b8f946491c7a56a25
child 111680 21a142b1a9d8a989a60cd41039c6ca4b2db0d563
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
milestone19.0a1
Add a comment about MOZ_BEGIN_ENUM_CLASS/MOZ_END_ENUM_CLASS to say that they should not be used for nested enums, no bug DONTBUILD
mfbt/Attributes.h
--- a/mfbt/Attributes.h
+++ b/mfbt/Attributes.h
@@ -351,16 +351,19 @@
  * enumerations, implicit conversions of Enum values to numeric types will
  * fail.  In other compilers, Enum itself will actually be defined as a class,
  * and some implicit conversions will fail while others will succeed.
  *
  * The type argument specifies the underlying type for the enum where
  * supported, as with MOZ_ENUM_TYPE().  For simplicity, it is currently
  * mandatory.  As with MOZ_ENUM_TYPE(), it will do nothing on compilers that do
  * not support it.
+ *
+ * Note that the workaround implemented here is not compatible with enums
+ * nested inside a class.
  */
 #if defined(MOZ_HAVE_CXX11_STRONG_ENUMS)
   /* All compilers that support strong enums also support an explicit
    * underlying type, so no extra check is needed */
 #  define MOZ_BEGIN_ENUM_CLASS(Name, type) enum class Name : type {
 #  define MOZ_END_ENUM_CLASS(Name)         };
 #else
    /**