title: Switch error:: cannot appear in a constant-expression
body: <p>this is a strange one...</p>
  
  <p>I am playing with some decompression algo. Instead of going through the <code>char buffer[]</code> and looping until a stop-bit in  <code>buffer[i]</code> is found, I am trying use some bit-mask techniques but with chars.</p>
  
  <p>I have the following example:  </p>
  
  <pre><code>// In a *.h file  
  const char ch = '\x81';  
  // To avoid Endianess  
  union CharUInt  
  {  
      char sz[4];  
      unsigned int u;  
  };  
  // Legal because char[] is declared before uint32 in the union  
  const CharUInt Mask1 = {'\x81', '\x0', '\x0', '\x81'};  
  const CharUInt Mask2 = {'\x0', '\x81', '\x81', '\x0'};  
  // Proxy / Auxillary uint32 as usimg Mask2.u in the switch blocked produced the same errors  
  const unsigned int uMask1 = Mask1.u;  
  const unsigned int uMask2 = Mask2.u;  
  const unsigned int uMask_ = (uMask1 &amp; uMask2);  
  // buf is always long enough  
  bool Foo(char buf[])  
  {  
      const CharUInt Type = {buf[0], buf[1], buf[2], buf[3]};  
      unsigned int uType = (Type.u &amp; uMask_);  
      switch(uType)  
      {  
      case uMask1:  
          // do stuff  
      case uMask2:    
          // do more stuff  
          return true;  
          break;  
      default:  
          // do different stuff  
          return false;  
          break;  
      }  
  };  
  </code></pre>
  
  <p>Without considering the syntax of the <code>union</code> stuff (the actual code compiles run fine for that) and without considering whether the function-return for <code>Foo</code> is pretty, I get<br>
  <code>'uMask1' cannot appear in a constant-expression</code><br>
  and if the unions themselves are used, I get<br>
  <code>'Mask1' cannot appear in a constant-expression</code><br>
  <code>'.' cannot appear in a constant-expression</code><br>
  and of course the errors also apply for uMask2 and Mask2.u</p>
  
  <p>What am I missing?</p>
  
  <p>Thanks in advance</p>