On Wed, Sep 16, 2009 at 11:42 PM, Eli Friedman <[email protected]> wrote:
> On Wed, Sep 16, 2009 at 11:31 PM, Daniel Dunbar <[email protected]> wrote:
> ==============================================================================
>> --- cfe/trunk/lib/AST/Expr.cpp (original)
>> +++ cfe/trunk/lib/AST/Expr.cpp Thu Sep 17 01:31:27 2009
>> @@ -1626,6 +1626,9 @@
>>  /// integer constant expression with the value zero, or if this is one that 
>> is
>>  /// cast to void*.
>>  bool Expr::isNullPointerConstant(ASTContext &Ctx) const {
>> +  // Ignore value dependent expressions.
>> +  if (isValueDependent())
>> +    return true;
>>   // Strip off a cast to void*, if it exists. Except in C++.
>>   if (const ExplicitCastExpr *CE = dyn_cast<ExplicitCastExpr>(this)) {
>>     if (!Ctx.getLangOptions().CPlusPlus) {
>
> It's kind of confusing to claim that something which may not be a null
> pointer constant is a null pointer constant.  It would be clearer for
> the callers to explicitly deal with this case.

Yes, I wasn't sure about this part. My logic was that assuming it was
a null pointer constant would be conservatively safe, but I can't
convince myself of this so I change it to an assert and FIXME that
part of the test for now.

 - Daniel

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to