[cfe-commits] r62928 - in /cfe/trunk: include/clang/Basic/DiagnosticKinds.def lib/Sema/Sema.h lib/Sema/SemaExpr.cpp test/Sema/exprs.c

Eli Friedman eli.friedman at gmail.com
Sat Jan 24 12:43:37 PST 2009


On Sat, Jan 24, 2009 at 12:17 PM, Chris Lattner <sabre at nondot.org> wrote:
> +  // alignof decl is always ok.
> +  if (isa<DeclRefExpr>(E))
> +    return false;

That looks wrong... what about something like the following?

extern struct x a;
int b = __alignof(a);

Wait, actually, it appears that gcc accepts this?!

Conceptually, it seems like a better fix for PR3386 would be adding
something like "if (!isSizeof && exprType->isIncompleteArrayType())
exprType = exprType->getAsArrayType()->getElementType();" at the
beginning of CheckSizeOfAlignOfOperand.

-Eli



More information about the cfe-commits mailing list