[cfe-dev] Pointer Arithmetic
onesadcookie at gmail.com
Thu Jul 12 18:49:37 CDT 2007
OK, a new patch, with apparently-working (pointer - pointer) too.
I've made getSize virtual in clang::Type (default implementation
asserts, and it should become pure virtual when it's implemented for
all the subclasses) and renamed the conflicting getSize in
clang::ArrayType to getSizeExpr.
I've added a getPointerDiffType alongside getSizeType, and updated
SemaExpr to return that type for (pointer - pointer).
There's a test case which checks that errors are generated or not as
appropriate in all cases (tests/Parser/pointer-arithmetic.c).
Again, criticism is welcome ;)
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 12810 bytes
Desc: not available
Url : http://lists.cs.uiuc.edu/pipermail/cfe-dev/attachments/20070713/33b03a4a/attachment.obj
More information about the cfe-dev