From 60f5da79e3de49b2074446e656a72970499a8d78 Mon Sep 17 00:00:00 2001 From: Saar Raz Date: Thu, 30 Jan 2020 20:47:59 +0200 Subject: [PATCH] [Concepts] Add 'this' context to instantiation of member requires clause 'this' context was missing in instantiation of member requires clause. --- clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp index 2e437cbe44d3c..2637b4cb6dcab 100755 --- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -2190,6 +2190,9 @@ Decl *TemplateDeclInstantiator::VisitCXXMethodDecl( if (TrailingRequiresClause) { EnterExpressionEvaluationContext ConstantEvaluated( SemaRef, Sema::ExpressionEvaluationContext::Unevaluated); + auto *ThisContext = dyn_cast_or_null(Owner); + Sema::CXXThisScopeRAII ThisScope(SemaRef, ThisContext, + D->getMethodQualifiers(), ThisContext); ExprResult SubstRC = SemaRef.SubstExpr(TrailingRequiresClause, TemplateArgs); if (SubstRC.isInvalid())