[clang] 60f5da7 - [Concepts] Add 'this' context to instantiation of member requires clause

Saar Raz via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 30 10:50:54 PST 2020


Author: Saar Raz
Date: 2020-01-30T20:47:59+02:00
New Revision: 60f5da79e3de49b2074446e656a72970499a8d78

URL: https://github.com/llvm/llvm-project/commit/60f5da79e3de49b2074446e656a72970499a8d78
DIFF: https://github.com/llvm/llvm-project/commit/60f5da79e3de49b2074446e656a72970499a8d78.diff

LOG: [Concepts] Add 'this' context to instantiation of member requires clause

'this' context was missing in instantiation of member requires clause.

Added: 
    

Modified: 
    clang/lib/Sema/SemaTemplateInstantiateDecl.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 2e437cbe44d3..2637b4cb6dca 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<CXXRecordDecl>(Owner);
+    Sema::CXXThisScopeRAII ThisScope(SemaRef, ThisContext,
+                                     D->getMethodQualifiers(), ThisContext);
     ExprResult SubstRC = SemaRef.SubstExpr(TrailingRequiresClause,
                                            TemplateArgs);
     if (SubstRC.isInvalid())


        


More information about the cfe-commits mailing list