<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>New patch, with test cases.<br><br><div><div id="SkyDrivePlaceholder"></div>> Date: Tue, 28 Aug 2012 13:18:52 -0700<br>> Subject: Re: [cfe-commits] [PATCH] PR11778 Switch promotions working properly<br>> From: dblaikie@gmail.com<br>> To: acharles@outlook.com<br>> CC: cfe-commits@cs.uiuc.edu<br>> <br>> Could you include the test cases in your patch?<br>> <br>> On Tue, Aug 28, 2012 at 1:11 PM, Ahmed Charles <acharles@outlook.com> wrote:<br>> > This makes switch statements like the following compile:<br>> ><br>> > int f1(char c) { switch(c) { case 256: case 0: return 1; } return 0; }<br>> > int f2(unsigned char c) { switch(c) { case 256: case 0: return 1; } return<br>> > 0; }<br>> > int f3(char c) { switch(c) { case 255 ... 256: case 0: return 1; } return 0;<br>> > }<br>> > int f3(unsigned char c) { switch(c) { case 255 ... 256: case 0: return 1; }<br>> > return 0; }<br>> ><br>> > The condition in the switch statement undergoes integer promotions,<br>> > therefore the above should compile, but doesn't. This also adds a warning<br>> > which tells the user when a case can't be reached.<br>> ><br>> > _______________________________________________<br>> > cfe-commits mailing list<br>> > cfe-commits@cs.uiuc.edu<br>> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits<br>> ><br></div>                                          </div></body>
</html>