1 matches bool, 2 matches long

Walter Bright newshound2 at digitalmars.com
Sat Apr 27 12:53:54 PDT 2013


On 4/26/2013 5:14 PM, H. S. Teoh wrote:
> Does VRP work only with literals, or does it work with general variables
> (by inferring from, say, if-conditions)?
>
> 	void func(int i) {
> 		ubyte b;
> 		if (i >= 0 && i < 256) {
> 			b = i;		// OK without cast?
> 		}
> 		...
> 	}

Such would require data flow analysis, which is beyond the scope of what the 
front end is designed to do. So, no, for the foreseeable future.



More information about the Digitalmars-d mailing list