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

Reid Kleckner via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 27 09:24:20 PDT 2015


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151027/c3dba1c2/attachment.html>


More information about the cfe-commits mailing list