[cfe-commits] r147561 - in /cfe/trunk: include/clang/AST/APValue.h lib/AST/APValue.cpp lib/AST/Expr.cpp lib/AST/ExprConstant.cpp lib/CodeGen/CGExprConstant.cpp lib/Sema/SemaChecking.cpp test/CodeGenCXX/const-init.cpp

Eli Friedman eli.friedman at gmail.com
Thu Jan 5 16:08:29 PST 2012


On Wed, Jan 4, 2012 at 5:53 PM, Richard Smith <richard at metafoo.co.uk> wrote:
>> +    if (!LHSVal.getLValueOffset().isZero() ||
>> +        !RHSVal.getLValueOffset().isZero())
>> +      return false;
>> +    const Expr *LHSExpr = LHSVal.getLValueBase().dyn_cast<const Expr*>();
>> +    const Expr *RHSExpr = RHSVal.getLValueBase().dyn_cast<const Expr*>();
>> +    if (!LHSExpr || !RHSExpr)
>> +      return false;
>> +    const AddrLabelExpr *LHSAddrExpr = dyn_cast<AddrLabelExpr>(LHSExpr);
>> +    const AddrLabelExpr *RHSAddrExpr = dyn_cast<AddrLabelExpr>(RHSExpr);
>> +    if (!LHSAddrExpr || !RHSAddrExpr)
>> +      return false;
>> +    Result = CCValue(LHSAddrExpr, RHSAddrExpr);
>> +    return true;
>> +  }
>
> Please add a CCEDiag to both these cases (we don't want to treat this as an
> ICE in C++11).

These can't be ICEs anyway: address-of-label expressions have type
void*, so they can't be subtracted without a reinterpret_cast.  Is
there any other reason to put in the CCEDiag?

Addressed the rest of the comments in r147631.

-Eli




More information about the cfe-commits mailing list