<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">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><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>