[cfe-commits] r89767 - /cfe/trunk/lib/Sema/SemaExprCXX.cpp

Douglas Gregor dgregor at apple.com
Tue Nov 24 08:07:02 PST 2009


Author: dgregor
Date: Tue Nov 24 10:07:02 2009
New Revision: 89767

URL: http://llvm.org/viewvc/llvm-project?rev=89767&view=rev
Log:
Un-break instantiation of if statements with conditional variables

Modified:
    cfe/trunk/lib/Sema/SemaExprCXX.cpp

Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=89767&r1=89766&r2=89767&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Tue Nov 24 10:07:02 2009
@@ -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.





More information about the cfe-commits mailing list