summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprCXX.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-11-24 16:07:02 +0000
committerDouglas Gregor <dgregor@apple.com>2009-11-24 16:07:02 +0000
commit0156d1c8db18e5b9eb694ecd9e933c717570854e (patch)
treec1f4a86548aa43aee6769ad6a5d0055b8e2377ee /clang/lib/Sema/SemaExprCXX.cpp
parentdb521ec23b6de14bb833308c1d0b82f94e0670df (diff)
downloadbcm5719-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.cpp11
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.
OpenPOWER on IntegriCloud