== Why is this an issue?

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

[source,cpp]
----
struct S
{
  AnEnumType n : 2; // Noncompliant
};
----


=== Compliant solution

[source,cpp]
----
struct S
{
 unsigned short n : 2; // Compliant
};
----


== Resources

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

ifdef::env-github,rspecator-view[]

'''
== Implementation Specification
(visible only on this page)

=== Message

Replace the enum type "xxx" with a type which is explicitly "signed" or "unsigned".


endif::env-github,rspecator-view[]
