23 nov 2009 kl. 15.44 skrev Douglas Gregor:

> Author: dgregor
> Date: Mon Nov 23 17:44:04 2009
> New Revision: 89717
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=89717&view=rev
> Log:
> Explicitly track the condition variable within an "if" statement,
> rather than burying it in a CXXConditionDeclExpr (that occassionally
> hides behind implicit conversions). Similar changes for
> switch, while, and do-while will follow, then the removal of
> CXXConditionDeclExpr. This commit is the canary.

This broke the following test:

void *f();

template <typename T> T* g() {
  if (T* t = f())
    return t;
    
  return 0;
}

void h() {
  void *a = g<void>();
}

which is very common in clang (getAs<FooType>() :)

Also, if you're getting rid of CXXConditionDeclExpr, then how are you going to 
disambiguate between

if (void * f = foo()) { }

and

void *f = foo();

if (f) { }

Since both cond exprs in this case are going to be DeclRefExprs.

Anders

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

Reply via email to