forked from OSchip/llvm-project
Remove redundant expression evaluation context when substituting into a
template argument. We do need one of these but we don't need two. llvm-svn: 364347
This commit is contained in:
parent
c42a357178
commit
dcd7eb710b
|
@ -3945,10 +3945,6 @@ template<typename Derived>
|
|||
bool TreeTransform<Derived>::TransformTemplateArgument(
|
||||
const TemplateArgumentLoc &Input,
|
||||
TemplateArgumentLoc &Output, bool Uneval) {
|
||||
EnterExpressionEvaluationContext EEEC(
|
||||
SemaRef, Sema::ExpressionEvaluationContext::ConstantEvaluated,
|
||||
/*LambdaContextDecl=*/nullptr, /*ExprContext=*/
|
||||
Sema::ExpressionEvaluationContextRecord::EK_TemplateArgument);
|
||||
const TemplateArgument &Arg = Input.getArgument();
|
||||
switch (Arg.getKind()) {
|
||||
case TemplateArgument::Null:
|
||||
|
@ -3997,9 +3993,11 @@ bool TreeTransform<Derived>::TransformTemplateArgument(
|
|||
case TemplateArgument::Expression: {
|
||||
// Template argument expressions are constant expressions.
|
||||
EnterExpressionEvaluationContext Unevaluated(
|
||||
getSema(), Uneval
|
||||
? Sema::ExpressionEvaluationContext::Unevaluated
|
||||
: Sema::ExpressionEvaluationContext::ConstantEvaluated);
|
||||
getSema(),
|
||||
Uneval ? Sema::ExpressionEvaluationContext::Unevaluated
|
||||
: Sema::ExpressionEvaluationContext::ConstantEvaluated,
|
||||
/*LambdaContextDecl=*/nullptr, /*ExprContext=*/
|
||||
Sema::ExpressionEvaluationContextRecord::EK_TemplateArgument);
|
||||
|
||||
Expr *InputExpr = Input.getSourceExpression();
|
||||
if (!InputExpr) InputExpr = Input.getArgument().getAsExpr();
|
||||
|
|
Loading…
Reference in New Issue