Index: lib/Sema/SemaTemplateInstantiateDecl.cpp =================================================================== --- lib/Sema/SemaTemplateInstantiateDecl.cpp +++ lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -3939,6 +3939,9 @@ if (PatternDecl->hasSkippedBody()) { ActOnSkippedFunctionBody(Function); + // FIXME: finishing the function body while in an expression evaluation + // context seems wrong. Investigate more. + ActOnFinishFunctionBody(Function, nullptr, /*IsInstantiation=*/true); } else { if (CXXConstructorDecl *Ctor = dyn_cast(Function)) { // If this is a constructor, instantiate the member initializers. @@ -3961,8 +3964,7 @@ // FIXME: finishing the function body while in an expression evaluation // context seems wrong. Investigate more. - ActOnFinishFunctionBody(Function, Body.get(), - /*IsInstantiation=*/true); + ActOnFinishFunctionBody(Function, Body.get(), /*IsInstantiation=*/true); } PerformDependentDiagnostics(PatternDecl, TemplateArgs);