<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 27, 2015 at 9:24 AM, Reid Kleckner via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Mon, Oct 26, 2015 at 11:02 PM, Richard Smith via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Modified: cfe/trunk/include/clang/Sema/ScopeInfo.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/ScopeInfo.h?rev=251387&r1=251386&r2=251387&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/ScopeInfo.h?rev=251387&r1=251386&r2=251387&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/Sema/ScopeInfo.h (original)<br>
+++ cfe/trunk/include/clang/Sema/ScopeInfo.h Tue Oct 27 01:02:45 2015<br>
@@ -89,40 +89,43 @@ protected:<br>
 public:<br>
   /// \brief What kind of scope we are describing.<br>
   ///<br>
-  ScopeKind Kind;<br>
+  ScopeKind Kind : 2;<br></blockquote><div><br></div></span><div>Nice try, Mr. Smith, but you can't outrun the long arm of MSVC! Recall that in MSVC, enums are always signed ints by default. Clang gives you this:</div><div><br></div><div><div>..\tools\clang\include\clang/Sema/ScopeInfo.h(616,10) :  warning: implicit truncation from 'clang::sema::FunctionScopeInfo::ScopeKind' to bitfield changes value from 3 to -1 [-Wbitfield-constant-conversion]</div><div>    Kind = SK_CapturedRegion;</div><div>         ^ ~~~~~~~~~~~~~~~~~</div><div>..\tools\clang\include\clang/Sema/ScopeInfo.h(714,10) :  warning: implicit truncation from 'clang::sema::FunctionScopeInfo::ScopeKind' to bitfield changes value from 2 to -2 [-Wbitfield-constant-conversion]</div><div>    Kind = SK_Lambda;</div><div>         ^ ~~~~~~~~~</div></div><div><br></div><div>I guess I'll bump it to 3 bits.<br></div></div></div></div></blockquote><div><br></div><div>Usually we workaround this by just not enum-ifying the bitfield, and casting the raw int/unsigned int/whatever to/from the enum type in setters/getters/etc. *shrug*</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div></div></div></div></div>
<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" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br></div></div>