r251387 - [coroutines] Creation of promise object, lookup of operator co_await, building

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 27 09:35:44 PDT 2015


On Tue, Oct 27, 2015 at 9:24 AM, Reid Kleckner via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

> On Mon, Oct 26, 2015 at 11:02 PM, Richard Smith via cfe-commits <
> cfe-commits at 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 at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151027/d64e6bdb/attachment.html>


More information about the cfe-commits mailing list