]> granicus.if.org Git - clang/commitdiff
Use the instantiated expressions to build the ConditionalOperator. This addresses...
authorGabor Greif <ggreif@gmail.com>
Wed, 18 Mar 2009 23:47:39 +0000 (23:47 +0000)
committerGabor Greif <ggreif@gmail.com>
Wed, 18 Mar 2009 23:47:39 +0000 (23:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67259 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaTemplateInstantiate.cpp

index 427946ad7c71236386fc102f85735256bdb048a5..4341fc94f90718550f11f308b9cbd2d30c5a9ef6 100644 (file)
@@ -843,15 +843,11 @@ TemplateExprInstantiator::VisitConditionalOperator(ConditionalOperator *E) {
     // Since our original expression was not type-dependent, we do not
     // perform lookup again at instantiation time (C++ [temp.dep]p1).
     // Instead, we just build the new conditional operator call expression.
-    Cond.release();
-    True.release();
-    False.release();
-    // FIXME: Don't reuse the parts here. We need to instantiate them.
     return SemaRef.Owned(new (SemaRef.Context) ConditionalOperator(
-                                                              E->getCond(),
-                                                              E->getTrueExpr(), 
-                                                              E->getFalseExpr(),
-                                                              E->getType()));
+                                                           Cond.takeAs<Expr>(),
+                                                           True.takeAs<Expr>(), 
+                                                           False.takeAs<Expr>(),
+                                                           E->getType()));
   }