Re: r247618 - C11 _Bool bitfield diagnostic

2015-09-23 Thread Richard Smith via cfe-commits
tic to provide a fixit suggesting >>>>>>>> using >>>>>>>> an anonymous bit-field to insert padding? >>>>>>>> >>>>>>> >>>>>>> Isn't the Right Fix (tm) to make bool bitfields 1 wide and

Re: r247618 - C11 _Bool bitfield diagnostic

2015-09-21 Thread Alexey Samsonov via cfe-commits
t; It depends; maybe the intent is to be compatible with some on-disk >>>>> format, and the explicit padding is important: >>>>> >>>>> struct X { >>>>> int n : 3; >>>>> bool b :

Re: r247618 - C11 _Bool bitfield diagnostic

2015-09-19 Thread Nico Weber via cfe-commits
anonymous >>>> bit-field would change the struct layout. >>>> >>>> >>>>> On Mon, Sep 14, 2015 at 11:06 PM, Richard Smith <rich...@metafoo.co.uk >>>>>>> > wrote: >>>>>>> >>>>>>>> On Mon,

Re: r247618 - C11 _Bool bitfield diagnostic

2015-09-18 Thread Richard Smith via cfe-commits
, it seems that the correct way to validate >>>>>> the width of a bit-field (ignoring the special case of MS in C mode) >>>>>> would >>>>>> be to use getIntWidth in C mode, and getTypeSize in C++ mode. >>>>>> >>>>>> I wou

Re: r247618 - C11 _Bool bitfield diagnostic

2015-09-18 Thread Nico Weber via cfe-commits
t;>>>>> bit-field may exceed the number of bits in the *object >>>>>>> representation* (which includes padding bits) of the specified >>>>>>> type, the extra bits will not take any part in the bit-field's *value >>>>>>> repres

Re: r247618 - C11 _Bool bitfield diagnostic

2015-09-18 Thread Richard Smith via cfe-commits
t;>>> >>>>>>>> As of 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 correc

Re: r247618 - C11 _Bool bitfield diagnostic

2015-09-16 Thread Richard Smith via cfe-commits
tTypeSize 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, >>>&

Re: r247618 - C11 _Bool bitfield diagnostic

2015-09-16 Thread Nico Weber via cfe-commits
M---On Mon, Sep 14, 2015 at 5:28 PM, Richard Smith <richard@metafo]Nico >>>> Weber ---09/14/2015 09:53:25 PM---On Mon, Sep 14, 2015 at 5:28 PM, Richard >>>> Smith <rich...@metafoo.co.uk> wrote: >>>> >>>> From: Nico Weber <tha...@chromiu

Re: r247618 - C11 _Bool bitfield diagnostic

2015-09-15 Thread Richard Smith via cfe-commits
r ---09/14/2015 09:53:25 PM---On Mon, Sep 14, 2015 at 5:28 PM, Richard >>> Smith <rich...@metafoo.co.uk> wrote: >>> >>> From: Nico Weber <tha...@chromium.org> >>> To: Richard Smith <rich...@metafoo.co.uk> >>> Cc: Rachel Craik/Toronto/IBM@IBM

Re: r247618 - C11 _Bool bitfield diagnostic

2015-09-15 Thread Nico Weber via cfe-commits
Nico >> Weber ---09/14/2015 09:53:25 PM---On Mon, Sep 14, 2015 at 5:28 PM, Richard >> Smith <rich...@metafoo.co.uk> wrote: >> >> From: Nico Weber <tha...@chromium.org> >> To: Richard Smith <rich...@metafoo.co.uk>

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=rev Log: C11 _Bool bitfield diagnostic Summary: Implement DR262 (for C). This patch will mainly affect bitfields of type _Bool Reviewers: fraggamuffin, rsmith Subscribers:

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

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,

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,

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: >> >>>

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