================ @@ -6124,7 +6124,11 @@ QualType TreeTransform<Derived>::TransformFunctionProtoType( // "pointer to cv-qualifier-seq X" between the optional cv-qualifer-seq // and the end of the function-definition, member-declarator, or // declarator. - Sema::CXXThisScopeRAII ThisScope(SemaRef, ThisContext, ThisTypeQuals); + auto *RD = + dyn_cast_or_null<CXXRecordDecl>(SemaRef.getCurLexicalContext()); + Sema::CXXThisScopeRAII ThisScope( + SemaRef, ThisContext == nullptr && nullptr != RD ? RD : ThisContext, + ThisTypeQuals); ---------------- jcsxky wrote:
Code Fixed and release note has been added. https://github.com/llvm/llvm-project/pull/78088 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits