title: The behavior of value-initializing an enum
body: <p>First, I want to say, according to cppreference.com, it is somewhat impossible to value-initialize an enum.</p>
  
  <p>According to <a href="http://en.cppreference.com/w/cpp/language/value_initialization" rel="noreferrer">http://en.cppreference.com/w/cpp/language/value_initialization</a>, value-initializing an enum actually performs zero-initialization. It then follows that, according to <a href="http://en.cppreference.com/w/cpp/language/zero_initialization" rel="noreferrer">http://en.cppreference.com/w/cpp/language/zero_initialization</a>, the effect of zero-initializing an enum is:</p>
  
  <blockquote>
    <p>If <code>T</code> is a scalar type, the object's initial value is the integral constant zero implicitly converted to <code>T</code>.</p>
  </blockquote>
  
  <p>However, an integral constant zero is not implicitly convertible to an enum. Ultimately, an enum cannot be value-initialized. This sounds weird, and value-initializing an enum does work on VC, GCC, and clang. So, what does the standard say about this?</p>
  
  <p>Second, according to <a href="http://en.cppreference.com/w/cpp/language/static_cast" rel="noreferrer">http://en.cppreference.com/w/cpp/language/static_cast</a>:</p>
  
  <blockquote>
    <p>Integer, floating-point, or enumeration type can be converted to any complete enumeration type (the result is unspecified (until C++17) undefined behavior (since C++17) if the value of expression, converted to the enumeration's underlying type, is not one of the target enumeration values)</p>
  </blockquote>
  
  <p>So, does this imply that value-initializing an enum (if it works at all) may actually lead to undefined behavior if the target enum does not have an enumerator equal to <code>0</code>?</p>