[cfe-commits] r41613 - in /cfe/trunk: AST/Expr.cpp Sema/Sema.h Sema/SemaExpr.cpp include/clang/AST/Expr.h include/clang/AST/StmtVisitor.h include/clang/Basic/DiagnosticKinds.def

Neil Booth neil at daikokuya.co.uk
Thu Aug 30 15:23:00 PDT 2007


Chris Lattner wrote:-

> On Fri, 31 Aug 2007, Neil Booth wrote:
> >>Author: lattner
> >>Date: Thu Aug 30 12:45:32 2007
> >>New Revision: 41613
> >>
> >>URL: http://llvm.org/viewvc/llvm-project?rev=41613&view=rev
> >>Log:
> >>implement initial sema support for __builtin_offsetof
> >It looks like clang has GCC's bug of forgetting that -> operator
> >in addition to [] operator can be used in offsetof.
> 
> It does!  Can you give an example that uses it?

I thought it would be instructive to figure that out yourself :)

struct s { struct { int t; } x[2]; };
int f (void) { return offsetof (struct s, x->t); }

Neil.



More information about the cfe-commits mailing list