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 | 0156d1c8db18e5b9eb694ecd9e933c717570854e (patch) | |
tree | c1f4a86548aa43aee6769ad6a5d0055b8e2377ee /clang/lib/Sema/SemaExprCXX.cpp | |
parent | db521ec23b6de14bb833308c1d0b82f94e0670df (diff) | |
download | bcm5719-llvm-0156d1c8db18e5b9eb694ecd9e933c717570854e.tar.gz bcm5719-llvm-0156d1c8db18e5b9eb694ecd9e933c717570854e.zip |
Un-break instantiation of if statements with conditional variables
llvm-svn: 89767
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExprCXX.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
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. |