annotate undefined/typedef_10_I.d @ 1576:b3e16c86558e

[Issue 1398] New: GDC doesn't generate correct code <mariusmuja@gmail.com> 2007-08-04 http://d.puremagic.com/issues/show_bug.cgi?id=1398
author thomask
date Thu, 21 Feb 2008 15:20:08 +0000
parents eb7e3f644b18
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
811
47da30a67c8d Stewart Gordon <smjg_1998@yahoo.com>
thomask
parents:
diff changeset
1 // $HeadURL$
47da30a67c8d Stewart Gordon <smjg_1998@yahoo.com>
thomask
parents:
diff changeset
2 // $Date$
47da30a67c8d Stewart Gordon <smjg_1998@yahoo.com>
thomask
parents:
diff changeset
3 // $Author$
47da30a67c8d Stewart Gordon <smjg_1998@yahoo.com>
thomask
parents:
diff changeset
4
47da30a67c8d Stewart Gordon <smjg_1998@yahoo.com>
thomask
parents:
diff changeset
5 // @author@ Stewart Gordon <smjg_1998@yahoo.com>
47da30a67c8d Stewart Gordon <smjg_1998@yahoo.com>
thomask
parents:
diff changeset
6 // @date@ 2005-12-12
47da30a67c8d Stewart Gordon <smjg_1998@yahoo.com>
thomask
parents:
diff changeset
7 // @uri@ news:dnjnqe$16sv$1@digitaldaemon.com
47da30a67c8d Stewart Gordon <smjg_1998@yahoo.com>
thomask
parents:
diff changeset
8
47da30a67c8d Stewart Gordon <smjg_1998@yahoo.com>
thomask
parents:
diff changeset
9 module dstress.undefined.typedef_10_I;
47da30a67c8d Stewart Gordon <smjg_1998@yahoo.com>
thomask
parents:
diff changeset
10
47da30a67c8d Stewart Gordon <smjg_1998@yahoo.com>
thomask
parents:
diff changeset
11 /* When typedefs are arithmetically combined, what should be the type of the
47da30a67c8d Stewart Gordon <smjg_1998@yahoo.com>
thomask
parents:
diff changeset
12 * result? The spec gives no indication. This testcase asserts the way I
47da30a67c8d Stewart Gordon <smjg_1998@yahoo.com>
thomask
parents:
diff changeset
13 * feel it should be. (Stewart Gordon)
47da30a67c8d Stewart Gordon <smjg_1998@yahoo.com>
thomask
parents:
diff changeset
14 */
47da30a67c8d Stewart Gordon <smjg_1998@yahoo.com>
thomask
parents:
diff changeset
15 typedef int Int;
47da30a67c8d Stewart Gordon <smjg_1998@yahoo.com>
thomask
parents:
diff changeset
16
47da30a67c8d Stewart Gordon <smjg_1998@yahoo.com>
thomask
parents:
diff changeset
17 int main() {
47da30a67c8d Stewart Gordon <smjg_1998@yahoo.com>
thomask
parents:
diff changeset
18 short s;
47da30a67c8d Stewart Gordon <smjg_1998@yahoo.com>
thomask
parents:
diff changeset
19 Int i;
47da30a67c8d Stewart Gordon <smjg_1998@yahoo.com>
thomask
parents:
diff changeset
20
47da30a67c8d Stewart Gordon <smjg_1998@yahoo.com>
thomask
parents:
diff changeset
21 static assert (is(typeof(s + i) == int));
944
eb7e3f644b18 Stewart Gordon <smjg_1998@yahoo.com>
thomask
parents: 811
diff changeset
22
eb7e3f644b18 Stewart Gordon <smjg_1998@yahoo.com>
thomask
parents: 811
diff changeset
23 return 0;
811
47da30a67c8d Stewart Gordon <smjg_1998@yahoo.com>
thomask
parents:
diff changeset
24 }