HomePhabricator

Fix assertion failure on MaybeODRUseExprs.

Description

Fix assertion failure on MaybeODRUseExprs.

In VisitNonTypeTemplateParamDecl, before SubstExpr with the default argument,
we should create a ConstantEvaluated ExpressionEvaluationContext. Without this,
it is possible to use a PotentiallyEvaluated ExpressionEvaluationContext; and
MaybeODRUseExprs will not be cleared when popping the context, causing
assertion failure.

This is similar to how we handle the context before SubstExpr with the
default argument, in SubstDefaultTemplateArgument.

Part of PR13986.
rdar://24480205

Differential Revision: http://reviews.llvm.org/D17576

Details

Committed
mrenFeb 24 2016, 3:05 PM
Differential Revision
D17576: Fix assertion failure on MaybeODRUseExprs.
Parents
rL261802: Make test more portable.
Branches
Unknown
Tags
Unknown