[cfe-dev] Pointer Arithmetic
onesadcookie at gmail.com
Thu Jul 12 16:49:37 PDT 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: 12811 bytes
Desc: not available
More information about the cfe-dev