diff options
| author | Douglas Gregor <dgregor@apple.com> | 2009-05-19 20:13:50 +0000 | 
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2009-05-19 20:13:50 +0000 | 
| commit | 115652db4af81d77d3de1ade54f4de0faf6bc0fb (patch) | |
| tree | 99772397791a401b024facff927df7e12b9d3192 /clang/lib/Sema | |
| parent | 3234db1e13d4fa60aa2341b83dc78c9030b3740b (diff) | |
| download | bcm5719-llvm-115652db4af81d77d3de1ade54f4de0faf6bc0fb.tar.gz bcm5719-llvm-115652db4af81d77d3de1ade54f4de0faf6bc0fb.zip | |
Fix handling of the GNU "t ? : f" extension to the conditional
operator in C++, and verify that template instantiation for the
condition operator does the right thing.
llvm-svn: 72127
Diffstat (limited to 'clang/lib/Sema')
| -rw-r--r-- | clang/lib/Sema/SemaTemplateInstantiateExpr.cpp | 16 | 
1 files changed, 8 insertions, 8 deletions
| diff --git a/clang/lib/Sema/SemaTemplateInstantiateExpr.cpp b/clang/lib/Sema/SemaTemplateInstantiateExpr.cpp index 9dda383342c..2589e301e0d 100644 --- a/clang/lib/Sema/SemaTemplateInstantiateExpr.cpp +++ b/clang/lib/Sema/SemaTemplateInstantiateExpr.cpp @@ -427,13 +427,13 @@ TemplateExprInstantiator::VisitConditionalOperator(ConditionalOperator *E) {    if (Cond.isInvalid())      return SemaRef.ExprError(); -  // FIXME: use getLHS() and cope with NULLness -  Sema::OwningExprResult True = Visit(E->getTrueExpr()); -  if (True.isInvalid()) +  Sema::OwningExprResult LHS = SemaRef.InstantiateExpr(E->getLHS(),  +                                                       TemplateArgs); +  if (LHS.isInvalid())      return SemaRef.ExprError(); -  Sema::OwningExprResult False = Visit(E->getFalseExpr()); -  if (False.isInvalid()) +  Sema::OwningExprResult RHS = Visit(E->getRHS()); +  if (RHS.isInvalid())      return SemaRef.ExprError();    if (!E->isTypeDependent()) {  @@ -442,15 +442,15 @@ TemplateExprInstantiator::VisitConditionalOperator(ConditionalOperator *E) {      // Instead, we just build the new conditional operator call expression.      return SemaRef.Owned(new (SemaRef.Context) ConditionalOperator(                                                             Cond.takeAs<Expr>(), -                                                           True.takeAs<Expr>(),  -                                                           False.takeAs<Expr>(), +                                                           LHS.takeAs<Expr>(),  +                                                           RHS.takeAs<Expr>(),                                                             E->getType()));    }    return SemaRef.ActOnConditionalOp(/*FIXME*/E->getCond()->getLocEnd(),                                      /*FIXME*/E->getFalseExpr()->getLocStart(), -                                    move(Cond), move(True), move(False)); +                                    move(Cond), move(LHS), move(RHS));  }  Sema::OwningExprResult  | 

