diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Sema/SemaExprCXX.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp index f2b82aa98b..6cf2cc6ef9 100644 --- a/lib/Sema/SemaExprCXX.cpp +++ b/lib/Sema/SemaExprCXX.cpp @@ -1017,10 +1017,19 @@ Action::OwningExprResult Sema::CheckConditionVariable(VarDecl *ConditionVar) { return ExprError(Diag(ConditionVar->getLocation(), diag::err_invalid_use_of_array_type) << ConditionVar->getSourceRange()); - + + // FIXME: Switch to building a DeclRefExpr, once we've eliminated the + // need for CXXConditionDeclExpr. +#if 0 return Owned(DeclRefExpr::Create(Context, 0, SourceRange(), ConditionVar, ConditionVar->getLocation(), ConditionVar->getType().getNonReferenceType())); +#else + return Owned(new (Context) CXXConditionDeclExpr( + ConditionVar->getSourceRange().getBegin(), + ConditionVar->getSourceRange().getEnd(), + ConditionVar)); +#endif } /// CheckCXXBooleanCondition - Returns true if a conversion to bool is invalid. |