• Home
  • Raw
  • Download

Lines Matching refs:SemaRef

45 static bool SubstQualifier(Sema &SemaRef, const DeclT *OldDecl, DeclT *NewDecl,  in SubstQualifier()  argument
54 SemaRef, in SubstQualifier()
60 = SemaRef.SubstNestedNameSpecifierLoc(OldDecl->getQualifierLoc(), in SubstQualifier()
72 return ::SubstQualifier(SemaRef, OldDecl, NewDecl, TemplateArgs); in SubstQualifier()
77 return ::SubstQualifier(SemaRef, OldDecl, NewDecl, TemplateArgs); in SubstQualifier()
787 LabelDecl *Inst = LabelDecl::Create(SemaRef.Context, Owner, D->getLocation(), in VisitLabelDecl()
801 = NamespaceAliasDecl::Create(SemaRef.Context, Owner, in VisitNamespaceAliasDecl()
818 DI = SemaRef.SubstType(DI, TemplateArgs, in InstantiateTypedefNameDecl()
822 DI = SemaRef.Context.getTrivialTypeSourceInfo(SemaRef.Context.IntTy); in InstantiateTypedefNameDecl()
825 SemaRef.MarkDeclarationsReferencedInType(D->getLocation(), DI->getType()); in InstantiateTypedefNameDecl()
836 RD->getEnclosingNamespaceContext() == SemaRef.getStdNamespace() && in InstantiateTypedefNameDecl()
839 SemaRef.getSourceManager().isInSystemHeader(D->getBeginLoc())) in InstantiateTypedefNameDecl()
841 DI = SemaRef.Context.getTrivialTypeSourceInfo( in InstantiateTypedefNameDecl()
847 Typedef = TypeAliasDecl::Create(SemaRef.Context, Owner, D->getBeginLoc(), in InstantiateTypedefNameDecl()
850 Typedef = TypedefDecl::Create(SemaRef.Context, Owner, D->getBeginLoc(), in InstantiateTypedefNameDecl()
867 NamedDecl *InstPrev = SemaRef.FindInstantiatedDecl(D->getLocation(), Prev, in InstantiateTypedefNameDecl()
875 SemaRef.isIncompatibleTypedef(InstPrevTypedef, Typedef); in InstantiateTypedefNameDecl()
880 SemaRef.InstantiateAttrs(TemplateArgs, D, Typedef); in InstantiateTypedefNameDecl()
883 SemaRef.inferGslPointerAttribute(Typedef); in InstantiateTypedefNameDecl()
908 LocalInstantiationScope Scope(SemaRef); in VisitTypeAliasTemplateDecl()
931 = TypeAliasTemplateDecl::Create(SemaRef.Context, Owner, D->getLocation(), in VisitTypeAliasTemplateDecl()
948 auto *NewBD = BindingDecl::Create(SemaRef.Context, Owner, D->getLocation(), in VisitBindingDecl()
951 SemaRef.CurrentInstantiationScope->InstantiatedLocal(D, NewBD); in VisitBindingDecl()
981 TypeSourceInfo *DI = SemaRef.SubstType( in VisitVarDecl()
988 SemaRef.Diag(D->getLocation(), diag::err_variable_instantiates_to_function) in VisitVarDecl()
995 SemaRef.adjustContextForLocalExternDecl(DC); in VisitVarDecl()
1000 Var = DecompositionDecl::Create(SemaRef.Context, DC, D->getInnerLocStart(), in VisitVarDecl()
1004 Var = VarDecl::Create(SemaRef.Context, DC, D->getInnerLocStart(), in VisitVarDecl()
1009 if (SemaRef.getLangOpts().ObjCAutoRefCount && in VisitVarDecl()
1010 SemaRef.inferObjCARCLifetime(Var)) in VisitVarDecl()
1013 if (SemaRef.getLangOpts().OpenCL) in VisitVarDecl()
1014 SemaRef.deduceOpenCLAddressSpace(Var); in VisitVarDecl()
1020 SemaRef.BuildVariableInstantiation(Var, D, TemplateArgs, LateAttrs, Owner, in VisitVarDecl()
1025 if (SemaRef.isCopyElisionCandidate(ReturnType, Var, Sema::CES_Strict)) in VisitVarDecl()
1032 SemaRef.CheckStaticLocalForDllExport(Var); in VisitVarDecl()
1039 = AccessSpecDecl::Create(SemaRef.Context, D->getAccess(), Owner, in VisitAccessSpecDecl()
1050 DI = SemaRef.SubstType(DI, TemplateArgs, in VisitFieldDecl()
1062 SemaRef.Diag(D->getLocation(), diag::err_field_instantiates_to_function) in VisitFieldDecl()
1067 SemaRef.MarkDeclarationsReferencedInType(D->getLocation(), DI->getType()); in VisitFieldDecl()
1076 SemaRef, Sema::ExpressionEvaluationContext::ConstantEvaluated); in VisitFieldDecl()
1079 = SemaRef.SubstExpr(BitWidth, TemplateArgs); in VisitFieldDecl()
1087 FieldDecl *Field = SemaRef.CheckFieldDecl(D->getDeclName(), in VisitFieldDecl()
1102 SemaRef.InstantiateAttrs(TemplateArgs, D, Field, LateAttrs, StartingScope); in VisitFieldDecl()
1105 SemaRef.CheckAlignasUnderalignment(Field); in VisitFieldDecl()
1112 SemaRef.Context.setInstantiatedFromUnnamedFieldDecl(Field, D); in VisitFieldDecl()
1117 SemaRef.CurrentInstantiationScope->InstantiatedLocal(D, Field); in VisitFieldDecl()
1132 SemaRef.Diag(D->getLocation(), diag::err_property_is_variably_modified) in VisitMSPropertyDecl()
1136 DI = SemaRef.SubstType(DI, TemplateArgs, in VisitMSPropertyDecl()
1148 SemaRef.Diag(D->getLocation(), diag::err_field_instantiates_to_function) in VisitMSPropertyDecl()
1153 SemaRef.MarkDeclarationsReferencedInType(D->getLocation(), DI->getType()); in VisitMSPropertyDecl()
1157 SemaRef.Context, Owner, D->getLocation(), D->getDeclName(), DI->getType(), in VisitMSPropertyDecl()
1160 SemaRef.InstantiateAttrs(TemplateArgs, D, Property, LateAttrs, in VisitMSPropertyDecl()
1174 new (SemaRef.Context)NamedDecl*[D->getChainingSize()]; in VisitIndirectFieldDecl()
1178 NamedDecl *Next = SemaRef.FindInstantiatedDecl(D->getLocation(), PI, in VisitIndirectFieldDecl()
1188 SemaRef.Context, Owner, D->getLocation(), D->getIdentifier(), T, in VisitIndirectFieldDecl()
1192 IndirectField->addAttr(Attr->clone(SemaRef.Context)); in VisitIndirectFieldDecl()
1212 InstTy = SemaRef.SubstType(Ty, TemplateArgs, in VisitFriendDecl()
1218 FriendDecl *FD = SemaRef.CheckFriendTypeDecl(D->getBeginLoc(), in VisitFriendDecl()
1240 FriendDecl::Create(SemaRef.Context, Owner, D->getLocation(), in VisitFriendDecl()
1253 SemaRef, Sema::ExpressionEvaluationContext::ConstantEvaluated); in VisitStaticAssertDecl()
1256 = SemaRef.SubstExpr(AssertExpr, TemplateArgs); in VisitStaticAssertDecl()
1260 return SemaRef.BuildStaticAssertDeclaration(D->getLocation(), in VisitStaticAssertDecl()
1270 NamedDecl *Prev = SemaRef.FindInstantiatedDecl(D->getLocation(), in VisitEnumDecl()
1278 EnumDecl::Create(SemaRef.Context, Owner, D->getBeginLoc(), in VisitEnumDecl()
1287 TypeSourceInfo *NewTI = SemaRef.SubstType(TI, TemplateArgs, UnderlyingLoc, in VisitEnumDecl()
1289 if (!NewTI || SemaRef.CheckEnumUnderlyingType(NewTI)) in VisitEnumDecl()
1290 Enum->setIntegerType(SemaRef.Context.IntTy); in VisitEnumDecl()
1300 SemaRef.InstantiateAttrs(TemplateArgs, D, Enum); in VisitEnumDecl()
1305 SemaRef.Context.setManglingNumber(Enum, SemaRef.Context.getManglingNumber(D)); in VisitEnumDecl()
1308 if (DeclaratorDecl *DD = SemaRef.Context.getDeclaratorForUnnamedTagDecl(D)) in VisitEnumDecl()
1309 SemaRef.Context.addDeclaratorForUnnamedTagDecl(Enum, DD); in VisitEnumDecl()
1312 if (TypedefNameDecl *TND = SemaRef.Context.getTypedefNameForUnnamedTagDecl(D)) in VisitEnumDecl()
1313 SemaRef.Context.addTypedefNameForUnnamedTagDecl(Enum, TND); in VisitEnumDecl()
1325 SemaRef.SubstType(TI->getType(), TemplateArgs, in VisitEnumDecl()
1327 SemaRef.CheckEnumRedeclaration(Def->getLocation(), Def->isScoped(), in VisitEnumDecl()
1340 SemaRef.CurrentInstantiationScope->InstantiatedLocal(D, Enum); in VisitEnumDecl()
1363 SemaRef, Sema::ExpressionEvaluationContext::ConstantEvaluated); in InstantiateEnumDefinition()
1365 Value = SemaRef.SubstExpr(UninstValue, TemplateArgs); in InstantiateEnumDefinition()
1376 = SemaRef.CheckEnumConstant(Enum, LastEnumConst, in InstantiateEnumDefinition()
1387 SemaRef.InstantiateAttrs(TemplateArgs, EC, EnumConst); in InstantiateEnumDefinition()
1398 SemaRef.CurrentInstantiationScope->InstantiatedLocal(EC, EnumConst); in InstantiateEnumDefinition()
1403 SemaRef.ActOnEnumBody(Enum->getLocation(), Enum->getBraceRange(), Enum, in InstantiateEnumDefinition()
1421 LocalInstantiationScope Scope(SemaRef); in VisitClassTemplateDecl()
1434 QualifierLoc = SemaRef.SubstNestedNameSpecifierLoc(QualifierLoc, in VisitClassTemplateDecl()
1461 DC = SemaRef.computeDeclContext(SS); in VisitClassTemplateDecl()
1464 DC = SemaRef.FindInstantiatedContext(Pattern->getLocation(), in VisitClassTemplateDecl()
1471 LookupResult R(SemaRef, Pattern->getDeclName(), Pattern->getLocation(), in VisitClassTemplateDecl()
1473 SemaRef.forRedeclarationInCurContext()); in VisitClassTemplateDecl()
1474 SemaRef.LookupQualifiedName(R, DC); in VisitClassTemplateDecl()
1483 SemaRef.Diag(Pattern->getLocation(), diag::err_not_tag_in_scope) in VisitClassTemplateDecl()
1517 if (!SemaRef.TemplateParameterListsAreEqual(InstParams, PrevParams, in VisitClassTemplateDecl()
1530 SemaRef.CheckTemplateParameterList(InstParams, PrevParams, in VisitClassTemplateDecl()
1537 SemaRef.Context, Pattern->getTagKind(), DC, Pattern->getBeginLoc(), in VisitClassTemplateDecl()
1544 SemaRef.InstantiateAttrsForDecl(TemplateArgs, Pattern, RecordInst, LateAttrs, in VisitClassTemplateDecl()
1548 = ClassTemplateDecl::Create(SemaRef.Context, DC, D->getLocation(), in VisitClassTemplateDecl()
1571 SemaRef.Context.getInjectedClassNameType(RecordInst, in VisitClassTemplateDecl()
1633 LocalInstantiationScope Scope(SemaRef); in VisitVarTemplateDecl()
1656 SemaRef.Context, DC, D->getLocation(), D->getIdentifier(), InstParams, in VisitVarTemplateDecl()
1714 LocalInstantiationScope Scope(SemaRef); in VisitFunctionTemplateDecl()
1754 SemaRef.CheckFriendAccess(InstTemplate); in VisitFunctionTemplateDecl()
1765 NamedDecl *Prev = SemaRef.FindInstantiatedDecl(D->getLocation(), in VisitCXXRecordDecl()
1773 SemaRef.Context, D->getTagKind(), Owner, D->getBeginLoc(), in VisitCXXRecordDecl()
1780 SemaRef.InstantiateAttrsForDecl(TemplateArgs, D, Record, LateAttrs, in VisitCXXRecordDecl()
1802 SemaRef.CurrentInstantiationScope->InstantiatedLocal(D, Record); in VisitCXXRecordDecl()
1805 SemaRef.Context.setManglingNumber(Record, in VisitCXXRecordDecl()
1806 SemaRef.Context.getManglingNumber(D)); in VisitCXXRecordDecl()
1810 if (DeclaratorDecl *DD = SemaRef.Context.getDeclaratorForUnnamedTagDecl(D)) in VisitCXXRecordDecl()
1811 SemaRef.Context.addDeclaratorForUnnamedTagDecl(Record, DD); in VisitCXXRecordDecl()
1815 if (TypedefNameDecl *TND = SemaRef.Context.getTypedefNameForUnnamedTagDecl(D)) in VisitCXXRecordDecl()
1816 SemaRef.Context.addTypedefNameForUnnamedTagDecl(Record, TND); in VisitCXXRecordDecl()
1823 Sema::LocalEagerInstantiationScope LocalInstantiations(SemaRef); in VisitCXXRecordDecl()
1825 SemaRef.InstantiateClass(D->getLocation(), Record, D, TemplateArgs, in VisitCXXRecordDecl()
1832 SemaRef.InstantiateClassMembers(D->getLocation(), Record, TemplateArgs, in VisitCXXRecordDecl()
1840 SemaRef.DiagnoseUnusedNestedTypedefs(Record); in VisitCXXRecordDecl()
1900 LocalInstantiationScope Scope(SemaRef, MergeWithParentScope); in VisitFunctionDecl()
1905 SemaRef, TemplateArgs, DGuide->getExplicitSpecifier(), DGuide); in VisitFunctionDecl()
1914 QualType T = adjustFunctionTypeForInstantiation(SemaRef.Context, D, TInfo); in VisitFunctionDecl()
1927 SemaRef.Context, TemplateParams->getTemplateLoc(), in VisitFunctionDecl()
1935 QualifierLoc = SemaRef.SubstNestedNameSpecifierLoc(QualifierLoc, in VisitFunctionDecl()
1945 SemaRef, Sema::ExpressionEvaluationContext::Unevaluated); in VisitFunctionDecl()
1946 ExprResult SubstRC = SemaRef.SubstExpr(TrailingRequiresClause, in VisitFunctionDecl()
1951 if (!SemaRef.CheckConstraintExpression(TrailingRequiresClause)) in VisitFunctionDecl()
1961 SemaRef.adjustContextForLocalExternDecl(DC); in VisitFunctionDecl()
1965 DC = SemaRef.computeDeclContext(SS); in VisitFunctionDecl()
1968 DC = SemaRef.FindInstantiatedContext(D->getLocation(), D->getDeclContext(), in VisitFunctionDecl()
1973 = SemaRef.SubstDeclarationNameInfo(D->getNameInfo(), TemplateArgs); in VisitFunctionDecl()
1981 SemaRef.Context, DC, D->getInnerLocStart(), in VisitFunctionDecl()
1989 SemaRef.Context, DC, D->getInnerLocStart(), NameInfo, T, TInfo, in VisitFunctionDecl()
2037 FunctionTemplate = FunctionTemplateDecl::Create(SemaRef.Context, DC, in VisitFunctionDecl()
2053 TemplateArgumentList::CreateCopy(SemaRef.Context, in VisitFunctionDecl()
2075 SemaRef, Function->getDeclName(), SourceLocation(), in VisitFunctionDecl()
2079 : SemaRef.forRedeclarationInCurContext()); in VisitFunctionDecl()
2088 if (SemaRef.Subst(Info->getTemplateArgs(), Info->getNumTemplateArgs(), in VisitFunctionDecl()
2094 Decl *Temp = SemaRef.FindInstantiatedDecl(D->getLocation(), in VisitFunctionDecl()
2102 if (SemaRef.CheckFunctionTemplateSpecialization(Function, in VisitFunctionDecl()
2111 SemaRef.LookupQualifiedName(Previous, DC); in VisitFunctionDecl()
2116 if (SemaRef.Subst(Info->getTemplateArgs(), Info->getNumTemplateArgs(), in VisitFunctionDecl()
2120 if (SemaRef.CheckFunctionTemplateSpecialization(Function, in VisitFunctionDecl()
2130 SemaRef.LookupQualifiedName(Previous, DC->getRedeclContext()); in VisitFunctionDecl()
2142 SemaRef.FilterLookupForScope(Previous, DC, /*Scope*/ nullptr, in VisitFunctionDecl()
2147 SemaRef.CheckFunctionDeclaration(/*Scope*/ nullptr, Function, Previous, in VisitFunctionDecl()
2155 SemaRef.CheckTemplateParameterList( in VisitFunctionDecl()
2173 SemaRef.PendingLocalImplicitInstantiations.push_back( in VisitFunctionDecl()
2184 SemaRef.SetDeclDeleted(Function, D->getLocation()); in VisitFunctionDecl()
2231 LocalInstantiationScope Scope(SemaRef, MergeWithParentScope); in VisitCXXMethodDecl()
2248 instantiateExplicitSpecifier(SemaRef, TemplateArgs, in VisitCXXMethodDecl()
2257 QualType T = adjustFunctionTypeForInstantiation(SemaRef.Context, D, TInfo); in VisitCXXMethodDecl()
2270 SemaRef.Context, TemplateParams->getTemplateLoc(), in VisitCXXMethodDecl()
2278 QualifierLoc = SemaRef.SubstNestedNameSpecifierLoc(QualifierLoc, in VisitCXXMethodDecl()
2288 SemaRef, Sema::ExpressionEvaluationContext::Unevaluated); in VisitCXXMethodDecl()
2290 Sema::CXXThisScopeRAII ThisScope(SemaRef, ThisContext, in VisitCXXMethodDecl()
2292 ExprResult SubstRC = SemaRef.SubstExpr(TrailingRequiresClause, in VisitCXXMethodDecl()
2297 if (!SemaRef.CheckConstraintExpression(TrailingRequiresClause)) in VisitCXXMethodDecl()
2306 DC = SemaRef.computeDeclContext(SS); in VisitCXXMethodDecl()
2308 if (DC && SemaRef.RequireCompleteDeclContext(SS, DC)) in VisitCXXMethodDecl()
2311 DC = SemaRef.FindInstantiatedContext(D->getLocation(), in VisitCXXMethodDecl()
2319 = SemaRef.SubstDeclarationNameInfo(D->getNameInfo(), TemplateArgs); in VisitCXXMethodDecl()
2331 SemaRef.Context, Record, StartLoc, NameInfo, T, TInfo, in VisitCXXMethodDecl()
2338 SemaRef.Context, Record, StartLoc, NameInfo, T, TInfo, in VisitCXXMethodDecl()
2344 SemaRef.Context, Record, StartLoc, NameInfo, T, TInfo, in VisitCXXMethodDecl()
2350 Method = CXXMethodDecl::Create(SemaRef.Context, Record, StartLoc, NameInfo, in VisitCXXMethodDecl()
2376 FunctionTemplate = FunctionTemplateDecl::Create(SemaRef.Context, Record, in VisitCXXMethodDecl()
2390 TemplateArgumentList::CreateCopy(SemaRef.Context, in VisitCXXMethodDecl()
2404 SemaRef.Context, in VisitCXXMethodDecl()
2420 LookupResult Previous(SemaRef, NameInfo, Sema::LookupOrdinaryName, in VisitCXXMethodDecl()
2434 if (SemaRef.Subst(Info->getTemplateArgs(), Info->getNumTemplateArgs(), in VisitCXXMethodDecl()
2440 Decl *Temp = SemaRef.FindInstantiatedDecl(D->getLocation(), in VisitCXXMethodDecl()
2448 if (SemaRef.CheckFunctionTemplateSpecialization(Method, in VisitCXXMethodDecl()
2457 SemaRef.LookupQualifiedName(Previous, DC); in VisitCXXMethodDecl()
2461 if (SemaRef.Subst(Info->getTemplateArgs(), Info->getNumTemplateArgs(), in VisitCXXMethodDecl()
2465 if (SemaRef.CheckFunctionTemplateSpecialization(Method, in VisitCXXMethodDecl()
2474 SemaRef.LookupQualifiedName(Previous, DC); in VisitCXXMethodDecl()
2475 if (SemaRef.CheckFunctionTemplateSpecialization(Method, nullptr, Previous)) in VisitCXXMethodDecl()
2480 SemaRef.LookupQualifiedName(Previous, Record); in VisitCXXMethodDecl()
2490 SemaRef.CheckFunctionDeclaration(nullptr, Method, Previous, in VisitCXXMethodDecl()
2494 SemaRef.CheckPureMethod(Method, SourceRange()); in VisitCXXMethodDecl()
2506 SemaRef.CheckOverrideControl(Method); in VisitCXXMethodDecl()
2514 SemaRef.SetDeclDeleted(Method, Method->getLocation()); in VisitCXXMethodDecl()
2520 SemaRef.CompleteMemberSpecialization(Method, Previous); in VisitCXXMethodDecl()
2535 SemaRef.CheckFriendAccess(Method); in VisitCXXMethodDecl()
2556 SemaRef.MarkFunctionReferenced(Loc, Method); in VisitCXXMethodDecl()
2576 return SemaRef.SubstParmVarDecl(D, TemplateArgs, /*indexAdjustment*/ 0, None, in VisitParmVarDecl()
2597 SemaRef.collectUnexpandedParameterPacks(ArgLoc, Unexpanded); in VisitTemplateTypeParmDecl()
2603 if (SemaRef.CheckParameterPacksForExpansion( in VisitTemplateTypeParmDecl()
2616 SemaRef.Context, Owner, D->getBeginLoc(), D->getLocation(), in VisitTemplateTypeParmDecl()
2638 if (SemaRef.Subst(TemplArgInfo->getTemplateArgs(), in VisitTemplateTypeParmDecl()
2643 if (SemaRef.AttachTypeConstraint( in VisitTemplateTypeParmDecl()
2655 SemaRef.SubstType(D->getDefaultArgumentInfo(), TemplateArgs, in VisitTemplateTypeParmDecl()
2663 SemaRef.CurrentInstantiationScope->InstantiatedLocal(D, Inst); in VisitTemplateTypeParmDecl()
2686 SemaRef.SubstType(D->getExpansionTypeSourceInfo(I), TemplateArgs, in VisitNonTypeTemplateParmDecl()
2692 SemaRef.CheckNonTypeTemplateParameterType(NewDI, D->getLocation()); in VisitNonTypeTemplateParmDecl()
2710 SemaRef.collectUnexpandedParameterPacks(Pattern, Unexpanded); in VisitNonTypeTemplateParmDecl()
2719 if (SemaRef.CheckParameterPacksForExpansion(Expansion.getEllipsisLoc(), in VisitNonTypeTemplateParmDecl()
2729 Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(SemaRef, I); in VisitNonTypeTemplateParmDecl()
2730 TypeSourceInfo *NewDI = SemaRef.SubstType(Pattern, TemplateArgs, in VisitNonTypeTemplateParmDecl()
2737 SemaRef.CheckNonTypeTemplateParameterType(NewDI, D->getLocation()); in VisitNonTypeTemplateParmDecl()
2754 Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(SemaRef, -1); in VisitNonTypeTemplateParmDecl()
2755 TypeSourceInfo *NewPattern = SemaRef.SubstType(Pattern, TemplateArgs, in VisitNonTypeTemplateParmDecl()
2761 SemaRef.CheckNonTypeTemplateParameterType(NewPattern, D->getLocation()); in VisitNonTypeTemplateParmDecl()
2762 DI = SemaRef.CheckPackExpansion(NewPattern, Expansion.getEllipsisLoc(), in VisitNonTypeTemplateParmDecl()
2771 DI = SemaRef.SubstType(D->getTypeSourceInfo(), TemplateArgs, in VisitNonTypeTemplateParmDecl()
2777 T = SemaRef.CheckNonTypeTemplateParameterType(DI, D->getLocation()); in VisitNonTypeTemplateParmDecl()
2779 T = SemaRef.Context.IntTy; in VisitNonTypeTemplateParmDecl()
2787 SemaRef.Context, Owner, D->getInnerLocStart(), D->getLocation(), in VisitNonTypeTemplateParmDecl()
2793 SemaRef.Context, Owner, D->getInnerLocStart(), D->getLocation(), in VisitNonTypeTemplateParmDecl()
2799 if (SemaRef.AttachTypeConstraint( in VisitNonTypeTemplateParmDecl()
2814 SemaRef, Sema::ExpressionEvaluationContext::ConstantEvaluated); in VisitNonTypeTemplateParmDecl()
2815 ExprResult Value = SemaRef.SubstExpr(D->getDefaultArgument(), TemplateArgs); in VisitNonTypeTemplateParmDecl()
2822 SemaRef.CurrentInstantiationScope->InstantiatedLocal(D, Param); in VisitNonTypeTemplateParmDecl()
2859 LocalInstantiationScope Scope(SemaRef); in VisitTemplateTemplateParmDecl()
2874 collectUnexpandedParameterPacks(SemaRef, D->getTemplateParameters(), in VisitTemplateTemplateParmDecl()
2882 if (SemaRef.CheckParameterPacksForExpansion(D->getLocation(), in VisitTemplateTemplateParmDecl()
2892 Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(SemaRef, I); in VisitTemplateTemplateParmDecl()
2893 LocalInstantiationScope Scope(SemaRef); in VisitTemplateTemplateParmDecl()
2908 Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(SemaRef, -1); in VisitTemplateTemplateParmDecl()
2910 LocalInstantiationScope Scope(SemaRef); in VisitTemplateTemplateParmDecl()
2918 LocalInstantiationScope Scope(SemaRef); in VisitTemplateTemplateParmDecl()
2928 SemaRef.Context, Owner, D->getLocation(), in VisitTemplateTemplateParmDecl()
2933 SemaRef.Context, Owner, D->getLocation(), in VisitTemplateTemplateParmDecl()
2940 SemaRef.SubstNestedNameSpecifierLoc(QualifierLoc, TemplateArgs); in VisitTemplateTemplateParmDecl()
2941 TemplateName TName = SemaRef.SubstTemplateName( in VisitTemplateTemplateParmDecl()
2946 SemaRef.Context, in VisitTemplateTemplateParmDecl()
2947 TemplateArgumentLoc(SemaRef.Context, TemplateArgument(TName), in VisitTemplateTemplateParmDecl()
2956 SemaRef.CurrentInstantiationScope->InstantiatedLocal(D, Param); in VisitTemplateTemplateParmDecl()
2966 = UsingDirectiveDecl::Create(SemaRef.Context, Owner, D->getLocation(), in VisitUsingDirectiveDecl()
2992 = SemaRef.SubstNestedNameSpecifierLoc(D->getQualifierLoc(), in VisitUsingDecl()
3002 if (auto *RD = dyn_cast<CXXRecordDecl>(SemaRef.CurContext)) in VisitUsingDecl()
3003 NameInfo.setName(SemaRef.Context.DeclarationNames.getCXXConstructorName( in VisitUsingDecl()
3004 SemaRef.Context.getCanonicalType(SemaRef.Context.getRecordType(RD)))); in VisitUsingDecl()
3011 LookupResult Prev(SemaRef, NameInfo, Sema::LookupUsingDeclName, in VisitUsingDecl()
3014 UsingDecl *NewUD = UsingDecl::Create(SemaRef.Context, Owner, in VisitUsingDecl()
3024 SemaRef.LookupQualifiedName(Prev, Owner); in VisitUsingDecl()
3027 if (SemaRef.CheckUsingDeclRedeclaration(D->getUsingLoc(), in VisitUsingDecl()
3035 SemaRef.CheckUsingDeclQualifier(D->getUsingLoc(), D->hasTypename(), in VisitUsingDecl()
3039 SemaRef.Context.setInstantiatedFromUsingDecl(NewUD, D); in VisitUsingDecl()
3048 SemaRef.CheckInheritingConstructorUsingDecl(NewUD); in VisitUsingDecl()
3062 cast_or_null<NamedDecl>(SemaRef.FindInstantiatedDecl( in VisitUsingDecl()
3069 if (SemaRef.CheckUsingShadowDecl(NewUD, InstTarget, Prev, PrevDecl)) in VisitUsingDecl()
3073 PrevDecl = cast_or_null<UsingShadowDecl>(SemaRef.FindInstantiatedDecl( in VisitUsingDecl()
3078 SemaRef.BuildUsingShadowDecl(/*Scope*/nullptr, NewUD, InstTarget, in VisitUsingDecl()
3080 SemaRef.Context.setInstantiatedFromUsingShadowDecl(InstShadow, Shadow); in VisitUsingDecl()
3083 SemaRef.CurrentInstantiationScope->InstantiatedLocal(Shadow, InstShadow); in VisitUsingDecl()
3106 SemaRef.collectUnexpandedParameterPacks(D->getQualifierLoc(), Unexpanded); in instantiateUnresolvedUsingDecl()
3107 SemaRef.collectUnexpandedParameterPacks(D->getNameInfo(), Unexpanded); in instantiateUnresolvedUsingDecl()
3114 if (SemaRef.CheckParameterPacksForExpansion( in instantiateUnresolvedUsingDecl()
3127 Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(SemaRef, -1); in instantiateUnresolvedUsingDecl()
3139 SemaRef.Diag(D->getEllipsisLoc(), in instantiateUnresolvedUsingDecl()
3147 Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(SemaRef, I); in instantiateUnresolvedUsingDecl()
3158 auto *NewD = SemaRef.BuildUsingPackDecl(D, Expansions); in instantiateUnresolvedUsingDecl()
3160 SemaRef.CurrentInstantiationScope->InstantiatedLocal(D, NewD); in instantiateUnresolvedUsingDecl()
3168 = SemaRef.SubstNestedNameSpecifierLoc(D->getQualifierLoc(), in instantiateUnresolvedUsingDecl()
3177 = SemaRef.SubstDeclarationNameInfo(D->getNameInfo(), TemplateArgs); in instantiateUnresolvedUsingDecl()
3182 SemaRef.ArgumentPackSubstitutionIndex != -1; in instantiateUnresolvedUsingDecl()
3186 NamedDecl *UD = SemaRef.BuildUsingDeclaration( in instantiateUnresolvedUsingDecl()
3192 SemaRef.Context.setInstantiatedFromUsingDecl(UD, D); in instantiateUnresolvedUsingDecl()
3211 SemaRef.FindInstantiatedDecl(D->getLocation(), UD, TemplateArgs)) in VisitUsingPackDecl()
3217 auto *NewD = SemaRef.BuildUsingPackDecl(D, Expansions); in VisitUsingPackDecl()
3219 SemaRef.CurrentInstantiationScope->InstantiatedLocal(D, NewD); in VisitUsingPackDecl()
3234 Expr *Var = SemaRef.SubstExpr(I, TemplateArgs).get(); in VisitOMPThreadPrivateDecl()
3240 SemaRef.CheckOMPThreadPrivateDecl(D->getLocation(), Vars); in VisitOMPThreadPrivateDecl()
3251 Expr *Var = SemaRef.SubstExpr(I, TemplateArgs).get(); in VisitOMPAllocateDecl()
3259 ExprResult NewE = SemaRef.SubstExpr(AC->getAllocator(), TemplateArgs); in VisitOMPAllocateDecl()
3262 OMPClause *IC = SemaRef.ActOnOpenMPAllocatorClause( in VisitOMPAllocateDecl()
3267 Sema::DeclGroupPtrTy Res = SemaRef.ActOnOpenMPAllocateDirective( in VisitOMPAllocateDecl()
3288 SubstReductionType = SemaRef.ActOnOpenMPDeclareReductionType( in VisitOMPDeclareReductionDecl()
3290 ParsedType::make(SemaRef.SubstType( in VisitOMPDeclareReductionDecl()
3306 SemaRef.CurrentInstantiationScope->findInstantiationOf(PrevDeclInScope) in VisitOMPDeclareReductionDecl()
3309 auto DRD = SemaRef.ActOnOpenMPDeclareReductionDirectiveStart( in VisitOMPDeclareReductionDecl()
3313 SemaRef.CurrentInstantiationScope->InstantiatedLocal(D, NewDRD); in VisitOMPDeclareReductionDecl()
3318 SemaRef.ActOnOpenMPDeclareReductionCombinerStart( in VisitOMPDeclareReductionDecl()
3320 SemaRef.CurrentInstantiationScope->InstantiatedLocal( in VisitOMPDeclareReductionDecl()
3323 SemaRef.CurrentInstantiationScope->InstantiatedLocal( in VisitOMPDeclareReductionDecl()
3327 Sema::CXXThisScopeRAII ThisScope(SemaRef, ThisContext, Qualifiers(), in VisitOMPDeclareReductionDecl()
3329 SubstCombiner = SemaRef.SubstExpr(Combiner, TemplateArgs).get(); in VisitOMPDeclareReductionDecl()
3330 SemaRef.ActOnOpenMPDeclareReductionCombinerEnd(NewDRD, SubstCombiner); in VisitOMPDeclareReductionDecl()
3334 VarDecl *OmpPrivParm = SemaRef.ActOnOpenMPDeclareReductionInitializerStart( in VisitOMPDeclareReductionDecl()
3336 SemaRef.CurrentInstantiationScope->InstantiatedLocal( in VisitOMPDeclareReductionDecl()
3339 SemaRef.CurrentInstantiationScope->InstantiatedLocal( in VisitOMPDeclareReductionDecl()
3343 SubstInitializer = SemaRef.SubstExpr(Init, TemplateArgs).get(); in VisitOMPDeclareReductionDecl()
3349 SemaRef.InstantiateVariableInitializer(OmpPrivParm, OldPrivParm, in VisitOMPDeclareReductionDecl()
3352 SemaRef.ActOnOpenMPDeclareReductionInitializerEnd(NewDRD, SubstInitializer, in VisitOMPDeclareReductionDecl()
3362 (void)SemaRef.ActOnOpenMPDeclareReductionDirectiveEnd( in VisitOMPDeclareReductionDecl()
3378 SubstMapperTy = SemaRef.ActOnOpenMPDeclareMapperType( in VisitOMPDeclareMapperDecl()
3380 ParsedType::make(SemaRef.SubstType(D->getType(), TemplateArgs, in VisitOMPDeclareMapperDecl()
3391 SemaRef.CurrentInstantiationScope->findInstantiationOf(PrevDeclInScope) in VisitOMPDeclareMapperDecl()
3398 SemaRef.StartOpenMPDSABlock(llvm::omp::OMPD_declare_mapper, DirName, in VisitOMPDeclareMapperDecl()
3401 ExprResult MapperVarRef = SemaRef.ActOnOpenMPDeclareMapperDirectiveVarDecl( in VisitOMPDeclareMapperDecl()
3403 SemaRef.CurrentInstantiationScope->InstantiatedLocal( in VisitOMPDeclareMapperDecl()
3407 Sema::CXXThisScopeRAII ThisScope(SemaRef, ThisContext, Qualifiers(), in VisitOMPDeclareMapperDecl()
3414 Expr *NE = SemaRef.SubstExpr(OE, TemplateArgs).get(); in VisitOMPDeclareMapperDecl()
3424 SemaRef.SubstNestedNameSpecifierLoc(OldC->getMapperQualifierLoc(), in VisitOMPDeclareMapperDecl()
3429 SemaRef.SubstDeclarationNameInfo(OldC->getMapperIdInfo(), TemplateArgs); in VisitOMPDeclareMapperDecl()
3432 OMPClause *NewC = SemaRef.ActOnOpenMPMapClause( in VisitOMPDeclareMapperDecl()
3438 SemaRef.EndOpenMPDSABlock(nullptr); in VisitOMPDeclareMapperDecl()
3441 Sema::DeclGroupPtrTy DG = SemaRef.ActOnOpenMPDeclareMapperDirective( in VisitOMPDeclareMapperDecl()
3445 SemaRef.CurrentInstantiationScope->InstantiatedLocal(D, NewDMD); in VisitOMPDeclareMapperDecl()
3488 cast_or_null<ClassTemplateDecl>(SemaRef.FindInstantiatedDecl( in VisitClassTemplateSpecializationDecl()
3502 if (SemaRef.Subst(ArgLocs.data(), ArgLocs.size(), in VisitClassTemplateSpecializationDecl()
3509 if (SemaRef.CheckTemplateArgumentList(InstClassTemplate, in VisitClassTemplateSpecializationDecl()
3527 SemaRef.CheckSpecializationInstantiationRedecl(D->getLocation(), in VisitClassTemplateSpecializationDecl()
3549 SemaRef.Diag(D->getLocation(), diag::err_redefinition) << PrevDecl; in VisitClassTemplateSpecializationDecl()
3550 SemaRef.Diag(PrevDecl->getDefinition()->getLocation(), in VisitClassTemplateSpecializationDecl()
3558 SemaRef.Context, D->getTagKind(), Owner, D->getBeginLoc(), in VisitClassTemplateSpecializationDecl()
3572 QualType CanonType = SemaRef.Context.getTemplateSpecializationType( in VisitClassTemplateSpecializationDecl()
3574 SemaRef.Context.getRecordType(InstD)); in VisitClassTemplateSpecializationDecl()
3583 TypeSourceInfo *WrittenTy = SemaRef.Context.getTemplateSpecializationTypeInfo( in VisitClassTemplateSpecializationDecl()
3601 SemaRef.InstantiateClass(D->getLocation(), InstD, D, TemplateArgs, in VisitClassTemplateSpecializationDecl()
3618 cast_or_null<VarTemplateDecl>(SemaRef.FindInstantiatedDecl( in VisitVarTemplateSpecializationDecl()
3628 if (SemaRef.Subst(TemplateArgsInfo.getArgumentArray(), in VisitVarTemplateSpecializationDecl()
3634 if (SemaRef.CheckTemplateArgumentList(InstVarTemplate, D->getLocation(), in VisitVarTemplateSpecializationDecl()
3647 if (PrevDecl && SemaRef.CheckSpecializationInstantiationRedecl( in VisitVarTemplateSpecializationDecl()
3665 SemaRef.SubstType(D->getTypeSourceInfo(), TemplateArgs, in VisitVarTemplateSpecializationDecl()
3671 SemaRef.Diag(D->getLocation(), diag::err_variable_instantiates_to_function) in VisitVarTemplateSpecializationDecl()
3678 SemaRef.Context, Owner, D->getInnerLocStart(), D->getLocation(), in VisitVarTemplateSpecializationDecl()
3687 if (SemaRef.getLangOpts().OpenCL) in VisitVarTemplateSpecializationDecl()
3688 SemaRef.deduceOpenCLAddressSpace(Var); in VisitVarTemplateSpecializationDecl()
3694 SemaRef.BuildVariableInstantiation(Var, D, TemplateArgs, LateAttrs, Owner, in VisitVarTemplateSpecializationDecl()
3706 unsigned DiagID = SemaRef.getDiagnostics().getCustomDiagID( in VisitFriendTemplateDecl()
3709 SemaRef.Diag(D->getLocation(), DiagID) in VisitFriendTemplateDecl()
3721 return RequiresExprBodyDecl::Create(SemaRef.Context, D->getDeclContext(), in VisitRequiresExprBodyDecl()
3751 T = SemaRef.Context.getFunctionType( in adjustForRewrite()
3752 SemaRef.Context.BoolTy, FPT->getParamTypes(), FPT->getExtProtoInfo()); in adjustForRewrite()
3761 SemaRef.Context.getTrivialTypeSourceInfo(T, Orig->getEndLoc()); in adjustForRewrite()
3771 SemaRef.Context.DeclarationNames.getCXXOperatorName(OO_EqualEqual)); in adjustForRewrite()
3841 SemaRef, Sema::ExpressionEvaluationContext::Unevaluated); in SubstTemplateParams()
3842 ExprResult Res = SemaRef.SubstExpr(E, TemplateArgs); in SubstTemplateParams()
3850 = TemplateParameterList::Create(SemaRef.Context, L->getTemplateLoc(), in SubstTemplateParams()
3881 LocalInstantiationScope Scope(SemaRef); in InstantiateClassTemplatePartialSpecialization()
3896 if (SemaRef.Subst(TemplArgInfo->getTemplateArgs(), in InstantiateClassTemplatePartialSpecialization()
3904 if (SemaRef.CheckTemplateArgumentList(ClassTemplate, in InstantiateClassTemplatePartialSpecialization()
3912 if (SemaRef.CheckTemplatePartialSpecializationArgs( in InstantiateClassTemplatePartialSpecialization()
3927 = SemaRef.Context.getTemplateSpecializationType(TemplateName(ClassTemplate), in InstantiateClassTemplatePartialSpecialization()
3938 = SemaRef.Context.getTemplateSpecializationTypeInfo( in InstantiateClassTemplatePartialSpecialization()
3960 SemaRef.Diag(PartialSpec->getLocation(), diag::err_partial_spec_redeclared) in InstantiateClassTemplatePartialSpecialization()
3962 SemaRef.Diag(PrevDecl->getLocation(), diag::note_prev_partial_spec_here) in InstantiateClassTemplatePartialSpecialization()
3963 << SemaRef.Context.getTypeDeclType(PrevDecl); in InstantiateClassTemplatePartialSpecialization()
3971 SemaRef.Context, PartialSpec->getTagKind(), Owner, in InstantiateClassTemplatePartialSpecialization()
3982 SemaRef.CheckTemplatePartialSpecialization(InstPartialSpec); in InstantiateClassTemplatePartialSpecialization()
4009 LocalInstantiationScope Scope(SemaRef); in InstantiateVarTemplatePartialSpecialization()
4024 if (SemaRef.Subst(TemplArgInfo->getTemplateArgs(), in InstantiateVarTemplatePartialSpecialization()
4032 if (SemaRef.CheckTemplateArgumentList(VarTemplate, PartialSpec->getLocation(), in InstantiateVarTemplatePartialSpecialization()
4037 if (SemaRef.CheckTemplatePartialSpecializationArgs( in InstantiateVarTemplatePartialSpecialization()
4050 QualType CanonType = SemaRef.Context.getTemplateSpecializationType( in InstantiateVarTemplatePartialSpecialization()
4060 TypeSourceInfo *WrittenTy = SemaRef.Context.getTemplateSpecializationTypeInfo( in InstantiateVarTemplatePartialSpecialization()
4080 SemaRef.Diag(PartialSpec->getLocation(), in InstantiateVarTemplatePartialSpecialization()
4083 SemaRef.Diag(PrevDecl->getLocation(), in InstantiateVarTemplatePartialSpecialization()
4089 TypeSourceInfo *DI = SemaRef.SubstType( in InstantiateVarTemplatePartialSpecialization()
4096 SemaRef.Diag(PartialSpec->getLocation(), in InstantiateVarTemplatePartialSpecialization()
4105 SemaRef.Context, Owner, PartialSpec->getInnerLocStart(), in InstantiateVarTemplatePartialSpecialization()
4117 SemaRef.CheckTemplatePartialSpecialization(InstPartialSpec); in InstantiateVarTemplatePartialSpecialization()
4123 SemaRef.BuildVariableInstantiation(InstPartialSpec, PartialSpec, TemplateArgs, in InstantiateVarTemplatePartialSpecialization()
4144 = SemaRef.SubstFunctionDeclType(OldTInfo, TemplateArgs, in SubstFunctionType()
4161 LocalInstantiationScope *Scope = SemaRef.CurrentInstantiationScope; in SubstFunctionType()
4166 SemaRef.getNumArgumentsInExpansion(OldParam->getType(), in SubstFunctionType()
4194 Params.push_back(SemaRef.BuildParmVarDeclForTypedef( in SubstFunctionType()
4219 if (SemaRef.SubstParmTypes(D->getLocation(), D->parameters(), nullptr, in SubstFunctionType()
4482 SemaRef.Context.setManglingNumber(New, in InitFunctionInstantiation()
4483 SemaRef.Context.getManglingNumber(Tmpl)); in InitFunctionInstantiation()
4494 ActiveInstType &ActiveInst = SemaRef.CodeSynthesisContexts.back(); in InitFunctionInstantiation()
4502 atTemplateEnd(SemaRef.TemplateInstCallbacks, SemaRef, ActiveInst); in InitFunctionInstantiation()
4505 atTemplateBegin(SemaRef.TemplateInstCallbacks, SemaRef, ActiveInst); in InitFunctionInstantiation()
4519 if (SemaRef.getLangOpts().CPlusPlus11 && in InitFunctionInstantiation()
4539 New->setType(SemaRef.Context.getFunctionType( in InitFunctionInstantiation()
4542 Sema::ContextRAII SwitchContext(SemaRef, New); in InitFunctionInstantiation()
4543 SemaRef.SubstExceptionSpec(New, Proto, TemplateArgs); in InitFunctionInstantiation()
4551 SemaRef.InstantiateAttrs(TemplateArgs, Definition, New, in InitFunctionInstantiation()
4568 if (isa<CXXDestructorDecl>(New) && SemaRef.getLangOpts().CPlusPlus11) in InitMethodInstantiation()
4569 SemaRef.AdjustDestructorExceptionSpec(cast<CXXDestructorDecl>(New)); in InitMethodInstantiation()
4587 NamedDecl *D = SemaRef.FindInstantiatedDecl(New->getLocation(), in SubstDefaultedFunction()
4599 SemaRef.Context, Lookups) in SubstDefaultedFunction()
4603 SemaRef.SetDeclDefaulted(New, Tmpl->getLocation()); in SubstDefaultedFunction()