[cfe-commits] [Patch] Type-qualifiers on condtitional expression

Tim Northover Tim.Northover at arm.com
Mon Apr 2 08:37:43 PDT 2012


On Monday 02 Apr 2012 16:13:11 Eli Friedman wrote:
> On Mon, Apr 2, 2012 at 4:46 AM, Tim Northover <Tim.Northover at arm.com> wrote:
> > Hi,
> > 
> > When doing something like this:
> > 
> > const int *CI;
> > int *I;
> > *(test ? I : CI) = 0
> > 
> > clang currently doesn't put the combined qualifiers on the output type,
> > which means that the assignment is allowed. I believe this patch
> > implements correct C99 semantics (and sane behaviour for non-CVR type
> > qualifiers).
> > 
> > Could someone review it please?
> 
> It would be nice to have tests for both "x ? incomplete : complete"
> and "z ? complete : incomplete" for the tests involving composite
> types.

Thanks Eli. I've attached an updated patch (also adds a two-way test for the 
const bit, but no other changes).

Could you commit it if it's OK? I don't have access yet.

Cheers.

Tim.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: union-quals-v2.patch
Type: text/x-patch
Size: 4460 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120402/32b3f07e/attachment.bin>


More information about the cfe-commits mailing list