[cfe-commits] [PATCH] PR11778 Switch promotions working properly

Ahmed Charles acharles at outlook.com
Fri Aug 31 13:55:03 PDT 2012


Ping. :)

From: acharles at outlook.com
To: dblaikie at gmail.com
Date: Wed, 29 Aug 2012 01:39:33 -0700
CC: cfe-commits at cs.uiuc.edu
Subject: Re: [cfe-commits] [PATCH] PR11778 Switch promotions working properly




I moved the test cases to more reasonable files.

From: acharles at outlook.com
To: dblaikie at gmail.com
Date: Tue, 28 Aug 2012 15:37:26 -0700
CC: cfe-commits at cs.uiuc.edu
Subject: Re: [cfe-commits] [PATCH] PR11778 Switch promotions working properly




New patch, with test cases.

> Date: Tue, 28 Aug 2012 13:18:52 -0700
> Subject: Re: [cfe-commits] [PATCH] PR11778 Switch promotions working properly
> From: dblaikie at gmail.com
> To: acharles at outlook.com
> CC: cfe-commits at cs.uiuc.edu
> 
> Could you include the test cases in your patch?
> 
> On Tue, Aug 28, 2012 at 1:11 PM, Ahmed Charles <acharles at outlook.com> wrote:
> > This makes switch statements like the following compile:
> >
> > int f1(char c) { switch(c) { case 256: case 0: return 1; } return 0; }
> > int f2(unsigned char c) { switch(c) { case 256: case 0: return 1; } return
> > 0; }
> > int f3(char c) { switch(c) { case 255 ... 256: case 0: return 1; } return 0;
> > }
> > int f3(unsigned char c) { switch(c) { case 255 ... 256: case 0: return 1; }
> > return 0; }
> >
> > The condition in the switch statement undergoes integer promotions,
> > therefore the above should compile, but doesn't. This also adds a warning
> > which tells the user when a case can't be reached.
> >
> > _______________________________________________
> > cfe-commits mailing list
> > cfe-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
> >
 		 	   		  

_______________________________________________
cfe-commits mailing list
cfe-commits at cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits 		 	   		  

_______________________________________________
cfe-commits mailing list
cfe-commits at cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120831/53a23b2f/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: switch-promotions.patch
Type: application/octet-stream
Size: 9247 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120831/53a23b2f/attachment.obj>


More information about the cfe-commits mailing list