From 0156d1c8db18e5b9eb694ecd9e933c717570854e Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Tue, 24 Nov 2009 16:07:02 +0000 Subject: Un-break instantiation of if statements with conditional variables llvm-svn: 89767 --- clang/lib/Sema/SemaExprCXX.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'clang/lib/Sema/SemaExprCXX.cpp') diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index f2b82aa98ba..6cf2cc6ef98 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/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. -- cgit v1.2.3