[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
Richard Smith
richard at metafoo.co.uk
Thu Jan 5 16:15:24 PST 2012
On Fri, January 6, 2012 00:08, Eli Friedman wrote:
> 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?
Ah, OK, that's fine then :) Thanks!
More information about the cfe-commits
mailing list