annotate run/t/typeinfo_03_C.d @ 1520:b5c0842014ef

adapted for DMD-1.013
author thomask
date Fri, 27 Apr 2007 17:23:42 +0000
parents 6666662e4363
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1449
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
1 // $HeadURL$
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
2 // $Date$
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
3 // $Author$
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
4
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
5 // @author@ Madeleine Freudenberg <madou@madou.org>
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
6 // @date@ 2007-04-01
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
7 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1089
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
8 // @desc@ [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
9
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
10 module dstress.run.t.typeinfo_03_C;
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
11
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
12 int main(){
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
13 auto t = typeid(int*);
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
14
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
15 int* a = new int;
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
16 int* b = new int;
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
17 *a = -10;
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
18 *b = int.max;
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
19
1520
b5c0842014ef adapted for DMD-1.013
thomask
parents: 1449
diff changeset
20 if(t.compare(a, b) < 0){
1449
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
21 assert(0);
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
22 }
1520
b5c0842014ef adapted for DMD-1.013
thomask
parents: 1449
diff changeset
23 if(0 < t.compare(b, a)){
1449
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
24 assert(0);
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
25 }
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
26
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
27 return 0;
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
28 }
6666662e4363 [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
thomask
parents:
diff changeset
29