[cfe-commits] r51918 - in /cfe/trunk: include/clang/Basic/DiagnosticKinds.def lib/AST/Expr.cpp lib/Sema/Sema.h lib/Sema/SemaDecl.cpp

Eli Friedman eli.friedman at gmail.com
Tue Jun 3 14:53:24 PDT 2008


On Tue, Jun 3, 2008 at 2:25 PM, Steve Naroff <snaroff at apple.com> wrote:
>
> On Jun 3, 2008, at 2:01 PM, Eli Friedman wrote:
>
>> Author: efriedma
>> Date: Tue Jun  3 16:01:11 2008
>> New Revision: 51918
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=51918&view=rev
>> Log:
>> Re-fix r51907 in a way which doesn't affect valid code. This essentially
>> moves the check for the invalid construct to a point where it doesn't
>> affect other uses of isIntegerConstantExpr, and we can warn properly
>> when the extension is used.  This makes it a bit more complicated, but
>> it's a lot cleaner.
>>
>> Steve, please tell me if this check is sufficient to handle the
>> relevant system header.  I know it's enough to handle the testcase, but
>> I don't know what exactly the original looks like.
>>
>
> The error has come back...

Bleh, figures that it wasn't that simple... the approach is generally
right, but my CalcFakeICEVal isn't nearly complete enough to deal with
something like that.  It really needs the full power of
isIntegerConstantExpr.  This is going to require some significant
refactoring of the constant expr stuff to fix cleanly, so that the
verification and calculation bits of constant exprs are separated.  I
won't be able to finish something that big anytime soon, so go ahead
and re-land your fix if you want.

> #define   __DARWIN_ALIGN(p)       ((__darwin_size_t)((char *)(p) + __DARWIN_ALIGNBYTES) &~ __DARWIN_ALIGNBYTES)

Stupid... all this trouble for an unnecessary char* cast.

-Eli



More information about the cfe-commits mailing list