diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-11-24 16:07:02 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-11-24 16:07:02 +0000 |
commit | a7605db78f39fa744da94faacee504e7601bb7c5 (patch) | |
tree | 58b504f442188b46f7a0600b105106873081bf97 | |
parent | 56eec2bc2188574459a514f3650d581e00683126 (diff) |
Un-break instantiation of if statements with conditional variables
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89767 91177308-0d34-0410-b5e6-96231b3b80d8
-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. |