[PATCH] Sema: Subst type default template args earlier

David Majnemer david.majnemer at gmail.com
Sat Aug 24 15:11:36 PDT 2013


  To the reviewers, I tried doing the following for the other cases:

    @@ -1888,7 +1893,11 @@ Decl *TemplateDeclInstantiator::VisitNonTypeTemplateParmDecl(
       if (Invalid)
         Param->setInvalidDecl();

    -  Param->setDefaultArgument(D->getDefaultArgument(), false);
    +  if (D->hasDefaultArgument()) {
    +    ExprResult Value = SemaRef.SubstExpr(D->getDefaultArgument(), TemplateArgs);
    +    if (!Value.isInvalid())
    +      Param->setDefaultArgument(Value.get(), false);
    +  }

       // Introduce this template parameter's instantiation into the instantiation

  However, doing this resulted in crashes as it seemed like we would be looking at arguments from the wrong depth.

http://llvm-reviews.chandlerc.com/D1507



More information about the cfe-commits mailing list