The use of ``++enum++`` as a bit-field type is prohibited because ISO/IEC 14882:2003 does not explicitly define the underlying representation as ``++signed++`` or ``++unsigned++``. It is therefore not possible to determine the exact number of bits required to represent all values in the enumeration.


== Noncompliant Code Example

----
struct S
{
  AnEnumType n : 2; // Noncompliant
};
----


== Compliant Solution

----
struct S
{
 unsigned short n : 2; // Compliant
};
----


== See

* MISRA {cpp}:2008, 9-6-3 - Bit-fields shall not have enum type.
* ISO/IEC 14882:2003

