On Tue, Oct 27, 2015 at 9:24 AM, Reid Kleckner via cfe-commits < cfe-commits@lists.llvm.org> wrote:
> On Mon, Oct 26, 2015 at 11:02 PM, Richard Smith via cfe-commits < > cfe-commits@lists.llvm.org> wrote: > >> Modified: cfe/trunk/include/clang/Sema/ScopeInfo.h >> URL: >> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/ScopeInfo.h?rev=251387&r1=251386&r2=251387&view=diff >> >> ============================================================================== >> --- cfe/trunk/include/clang/Sema/ScopeInfo.h (original) >> +++ cfe/trunk/include/clang/Sema/ScopeInfo.h Tue Oct 27 01:02:45 2015 >> @@ -89,40 +89,43 @@ protected: >> public: >> /// \brief What kind of scope we are describing. >> /// >> - ScopeKind Kind; >> + ScopeKind Kind : 2; >> > > 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: > > ..\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] > Kind = SK_CapturedRegion; > ^ ~~~~~~~~~~~~~~~~~ > ..\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] > Kind = SK_Lambda; > ^ ~~~~~~~~~ > > I guess I'll bump it to 3 bits. > 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* > > _______________________________________________ > cfe-commits mailing list > cfe-commits@lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits > >
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits