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
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index f2b82aa..6cf2cc6 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -1017,10 +1017,19 @@
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.