forked from OSchip/llvm-project
incorporate review comment (about the optimization when we have a non-typedependent expression)
llvm-svn: 67226
This commit is contained in:
parent
25d1dc2a20
commit
8c97d18445
|
@ -839,8 +839,24 @@ TemplateExprInstantiator::VisitConditionalOperator(ConditionalOperator *E) {
|
||||||
if (False.isInvalid())
|
if (False.isInvalid())
|
||||||
return SemaRef.ExprError();
|
return SemaRef.ExprError();
|
||||||
|
|
||||||
return SemaRef.ActOnConditionalOp(E->getCond()->getLocEnd(),
|
if (!E->isTypeDependent()) {
|
||||||
E->getFalseExpr()->getLocStart(),
|
// 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()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return SemaRef.ActOnConditionalOp(/*FIXME*/E->getCond()->getLocEnd(),
|
||||||
|
/*FIXME*/E->getFalseExpr()->getLocStart(),
|
||||||
move(Cond), move(True), move(False));
|
move(Cond), move(True), move(False));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue