Re: r247618 - C11 _Bool bitfield diagnostic

2015-09-23 Thread Richard Smith via cfe-commits
gt; padding bits, or we don't. >>> >> >> Yup, makes sense. >> >> >>> >>> >>>> , but it doesn't seem likely they got that effect. Would you be more >>>>>>>> convinced if we amended the diagnostic to provide a

Re: r247618 - C11 _Bool bitfield diagnostic

2015-09-21 Thread Alexey Samsonov via cfe-commits
insert padding? >>>>>>> >>>>>> >>>>>> Isn't the Right Fix (tm) to make bool bitfields 1 wide and rely on >>>>>> the compiler to figure out padding? >>>>>> >>>>> &

Re: r247618 - C11 _Bool bitfield diagnostic

2015-09-18 Thread Nico Weber via cfe-commits
padding is important: >>>> >>>> struct X { >>>> int n : 3; >>>> bool b : 3; >>>> int n : 2; >>>> }; >>>> >>>> Changing the bool bit-field to 1 bit without inserting an anonymous >>>> bi

Re: r247618 - C11 _Bool bitfield diagnostic

2015-09-18 Thread Richard Smith via cfe-commits
DR262, the C standard clarified that the width of a bit-field >>>>>>>> can not exceed that of the specified type, and this change was >>>>>>>> primarily to >>>>>>>> ensure that Clang correctly enforced this part of the stand

Re: r247618 - C11 _Bool bitfield diagnostic

2015-09-18 Thread Nico Weber via cfe-commits
to >>>>>>> ensure that Clang correctly enforced this part of the standard. Looking >>>>>>> at >>>>>>> the C++11 standard again, it states that although the specified width >>>>>>> of a >>>>>>> bit-fiel

Re: r247618 - C11 _Bool bitfield diagnostic

2015-09-18 Thread Richard Smith via cfe-commits
;>>>>> representation* (which includes padding bits) of the specified type, >>>>>> the extra bits will not take any part in the bit-field's *value >>>>>> representation*. >>

Re: r247618 - C11 _Bool bitfield diagnostic

2015-09-16 Thread Richard Smith via cfe-commits
h in C mode, and getTypeSize in C++ mode. >>>>> >>>>> I would be happy create a patch to make this change tomorrow if people >>>>> are in agreement. >>>>> >>>> David Majnemer has already landed a couple of changes to fix this up, &g

Re: r247618 - C11 _Bool bitfield diagnostic

2015-09-16 Thread Nico Weber via cfe-commits
ple of changes to fix this up, so >>> hopefully that won't be necessary. Thanks for working on this! >>> >>>> Rachel >>>> >>>> >>>> [image: Inactive hide details for Nico Weber ---09/14/2015 09:53:25 >>>> PM---On M

Re: r247618 - C11 _Bool bitfield diagnostic

2015-09-15 Thread Richard Smith via cfe-commits
this! >> >>> Rachel >>> >>> >>> [image: Inactive hide details for Nico Weber ---09/14/2015 09:53:25 >>> PM---On Mon, Sep 14, 2015 at 5:28 PM, Richard Smith >> Weber ---09/14/2015 09:53:25 PM---On Mon, Sep

Re: r247618 - C11 _Bool bitfield diagnostic

2015-09-15 Thread Nico Weber via cfe-commits
Mon, Sep 14, 2015 at 5:28 PM, Richard >> Smith wrote: >> >> From: Nico Weber >> To: Richard Smith >> Cc: Rachel Craik/Toronto/IBM@IBMCA, cfe-commits < >> cfe-commits@lists.llvm.org> >> Date: 09/14/2015 09:53 PM >> Subject: Re: r247618 - C11 _Bool bitf

Re: r247618 - C11 _Bool bitfield diagnostic

2015-09-14 Thread Richard Smith via cfe-commits
5:28 PM, Richard Smith Weber ---09/14/2015 09:53:25 PM---On Mon, Sep 14, 2015 at 5:28 PM, Richard > Smith wrote: > > From: Nico Weber > To: Richard Smith > Cc: Rachel Craik/Toronto/IBM@IBMCA, cfe-commits < > cfe-commits@lists.llvm.org> > Date: 09/14/

Re: r247618 - C11 _Bool bitfield diagnostic

2015-09-14 Thread Richard Smith via cfe-commits
015 at 5:28 PM, Richard Smith Weber ---09/14/2015 09:53:25 PM---On Mon, Sep 14, 2015 at 5:28 PM, Richard > Smith wrote: > > From: Nico Weber > To: Richard Smith > Cc: Rachel Craik/Toronto/IBM@IBMCA, cfe-commits < > cfe-commits@lists.llvm.org&g

Re: r247618 - C11 _Bool bitfield diagnostic

2015-09-14 Thread Rachel Craik via cfe-commits
, cfe-commits Date: 09/14/2015 09:53 PM Subject: Re: r247618 - C11 _Bool bitfield diagnostic Sent by:tha...@google.com On Mon, Sep 14, 2015 at 5:28 PM, Richard Smith wrote: On Mon, Sep 14, 2015 at 5:18 PM, Nico Weber via cfe-commits < cfe-commits@lists.llvm.or

Re: r247618 - C11 _Bool bitfield diagnostic

2015-09-14 Thread Nico Weber via cfe-commits
On Mon, Sep 14, 2015 at 5:28 PM, Richard Smith wrote: > On Mon, Sep 14, 2015 at 5:18 PM, Nico Weber via cfe-commits < > cfe-commits@lists.llvm.org> wrote: > >> This also fires for bool in C++ files, even though the commit message >> saying C11 and _Bool. Given the test changes, I suppose that's i

Re: r247618 - C11 _Bool bitfield diagnostic

2015-09-14 Thread Richard Smith via cfe-commits
On Mon, Sep 14, 2015 at 6:10 PM, David Majnemer wrote: > On Mon, Sep 14, 2015 at 6:01 PM, Richard Smith > wrote: > >> On Mon, Sep 14, 2015 at 5:55 PM, David Majnemer > > wrote: >> >>> On Mon, Sep 14, 2015 at 5:40 PM, Richard Smith >>> wrote: >>> On Mon, Sep 14, 2015 at 5:31 PM, David Majne

Re: r247618 - C11 _Bool bitfield diagnostic

2015-09-14 Thread David Majnemer via cfe-commits
On Mon, Sep 14, 2015 at 6:01 PM, Richard Smith wrote: > On Mon, Sep 14, 2015 at 5:55 PM, David Majnemer > wrote: > >> On Mon, Sep 14, 2015 at 5:40 PM, Richard Smith >> wrote: >> >>> On Mon, Sep 14, 2015 at 5:31 PM, David Majnemer < >>> david.majne...@gmail.com> wrote: >>> On Mon, Sep 14, 2

Re: r247618 - C11 _Bool bitfield diagnostic

2015-09-14 Thread Richard Smith via cfe-commits
On Mon, Sep 14, 2015 at 5:55 PM, David Majnemer wrote: > On Mon, Sep 14, 2015 at 5:40 PM, Richard Smith > wrote: > >> On Mon, Sep 14, 2015 at 5:31 PM, David Majnemer > > wrote: >> >>> On Mon, Sep 14, 2015 at 5:28 PM, Richard Smith via cfe-commits < >>> cfe-commits@lists.llvm.org> wrote: >>>

Re: r247618 - C11 _Bool bitfield diagnostic

2015-09-14 Thread David Majnemer via cfe-commits
On Mon, Sep 14, 2015 at 5:40 PM, Richard Smith wrote: > On Mon, Sep 14, 2015 at 5:31 PM, David Majnemer > wrote: > >> On Mon, Sep 14, 2015 at 5:28 PM, Richard Smith via cfe-commits < >> cfe-commits@lists.llvm.org> wrote: >> >>> On Mon, Sep 14, 2015 at 5:18 PM, Nico Weber via cfe-commits < >>> cf

Re: r247618 - C11 _Bool bitfield diagnostic

2015-09-14 Thread Richard Smith via cfe-commits
On Mon, Sep 14, 2015 at 5:31 PM, David Majnemer wrote: > On Mon, Sep 14, 2015 at 5:28 PM, Richard Smith via cfe-commits < > cfe-commits@lists.llvm.org> wrote: > >> On Mon, Sep 14, 2015 at 5:18 PM, Nico Weber via cfe-commits < >> cfe-commits@lists.llvm.org> wrote: >> >>> This also fires for bool i

Re: r247618 - C11 _Bool bitfield diagnostic

2015-09-14 Thread David Majnemer via cfe-commits
On Mon, Sep 14, 2015 at 5:28 PM, Richard Smith via cfe-commits < cfe-commits@lists.llvm.org> wrote: > On Mon, Sep 14, 2015 at 5:18 PM, Nico Weber via cfe-commits < > cfe-commits@lists.llvm.org> wrote: > >> This also fires for bool in C++ files, even though the commit message >> saying C11 and _Boo

Re: r247618 - C11 _Bool bitfield diagnostic

2015-09-14 Thread Richard Smith via cfe-commits
On Mon, Sep 14, 2015 at 5:18 PM, Nico Weber via cfe-commits < cfe-commits@lists.llvm.org> wrote: > This also fires for bool in C++ files, even though the commit message > saying C11 and _Bool. Given the test changes, I suppose that's intentional? > This fires a lot on existing code, for example pr

Re: r247618 - C11 _Bool bitfield diagnostic

2015-09-14 Thread NAKAMURA Takumi via cfe-commits
It affects for targeting MS. Tweaked one test in r247640. You can emulate to add -mms-bitfields. On Tue, Sep 15, 2015 at 6:29 AM Rachel Craik via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Author: rcraik > Date: Mon Sep 14 16:27:36 2015 > New Revision: 247618 > > URL: http://llvm.org/vie

Re: r247618 - C11 _Bool bitfield diagnostic

2015-09-14 Thread Nico Weber via cfe-commits
This also fires for bool in C++ files, even though the commit message saying C11 and _Bool. Given the test changes, I suppose that's intentional? This fires a lot on existing code, for example protobuf: ../../third_party/protobuf/src/google/protobuf/extension_set.h:465:10: error: width of bit-fiel

r247618 - C11 _Bool bitfield diagnostic

2015-09-14 Thread Rachel Craik via cfe-commits
Author: rcraik Date: Mon Sep 14 16:27:36 2015 New Revision: 247618 URL: http://llvm.org/viewvc/llvm-project?rev=247618&view=rev Log: C11 _Bool bitfield diagnostic Summary: Implement DR262 (for C). This patch will mainly affect bitfields of type _Bool Reviewers: fraggamuffin, rsmith Subscribers