Pointer arithmetic

The following error is not diagnosed.

int test(int *a, double *b) { return a - b; }

By the way, this does crash in CodeGen. Can CodeGen assume that the
code is correctly typed, or is it still a good idea to sprinkle
asserts in CodeGen?

The following error is not diagnosed.

int test(int *a, double *b) { return a - b; }

Yep, as it turns out, we were completely missing the requires sema checks for pointer subtraction. I implemented these here:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20071203/003235.html

By the way, this does crash in CodeGen. Can CodeGen assume that the
code is correctly typed, or is it still a good idea to sprinkle
asserts in CodeGen?

CodeGen can assume that Sema reported no errors, but it has to tolerate code that only produces warnings.

-Chris