aaron.ballman added a comment.

In D131255#3702286 <https://reviews.llvm.org/D131255#3702286>, @ShawnZhong 
wrote:

> Thanks for the quick reply and the reference on the C standard!
>
> On the C++ side, Section C.1.8 specified that `int` bit-fields are signed:
>
>> Change: Bit-fields of type plain int are signed.
>> Rationale: Leaving the choice of signedness to implementations could lead to 
>> inconsistent definitions of template specializations. For consistency, the 
>> implementation freedom was eliminated for non-dependent types, too.
>> Effect on original feature: The choise is implementation-defined in C, but 
>> not so in C++.

Agreed; I think that's falling out from 
https://eel.is/c++draft/class.bit#4.sentence-1 and 
https://eel.is/c++draft/basic.fundamental#1.sentence-1.

> Implementation-wise, I'll see what I can find in CodeGen on whether `int` 
> bit-fields are signed for C

Thanks!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131255/new/

https://reviews.llvm.org/D131255

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to