<p dir="ltr"><br>
On Aug 27, 2015 7:38 AM, "Marshall Clow via cfe-commits" <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br>
><br>
> Author: marshall<br>
> Date: Thu Aug 27 09:37:22 2015<br>
> New Revision: 246150<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=246150&view=rev">http://llvm.org/viewvc/llvm-project?rev=246150&view=rev</a><br>
> Log:<br>
> Remove a switch statement, and replace with a bunch of ifs to silence a warning about 'all the enumeration values covered'. No functional change.</p>
<p dir="ltr">Just for the record you can also supports this'd warning by casting the switch expression to an integer type. (If I've correctly understood the warning your getting)</p>
<p dir="ltr">><br>
> Modified:<br>
>     libcxx/trunk/include/locale<br>
><br>
> Modified: libcxx/trunk/include/locale<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/locale?rev=246150&r1=246149&r2=246150&view=diff">http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/locale?rev=246150&r1=246149&r2=246150&view=diff</a><br>
> ==============================================================================<br>
> --- libcxx/trunk/include/locale (original)<br>
> +++ libcxx/trunk/include/locale Thu Aug 27 09:37:22 2015<br>
> @@ -4316,18 +4316,9 @@ wbuffer_convert<_Codecvt, _Elem, _Tr>::s<br>
>      int __width = __cv_->encoding();<br>
>      if (__cv_ == 0 || __bufptr_ == 0 || (__width <= 0 && __off != 0) || sync())<br>
>          return pos_type(off_type(-1));<br>
> -    // __width > 0 || __off == 0<br>
> -    switch (__way)<br>
> -    {<br>
> -    case ios_base::beg:<br>
> -        break;<br>
> -    case ios_base::cur:<br>
> -        break;<br>
> -    case ios_base::end:<br>
> -        break;<br>
> -    default:<br>
> +    // __width > 0 || __off == 0, now check __way<br>
> +    if (__way != ios_base::beg && __way != ios_base::cur && __way != ios_base::end)<br>
>          return pos_type(off_type(-1));<br>
> -    }<br>
>      pos_type __r = __bufptr_->pubseekoff(__width * __off, __way, __om);<br>
>      __r.state(__st_);<br>
>      return __r;<br>
><br>
><br>
> _______________________________________________<br>
> cfe-commits mailing list<br>
> <a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</p>