• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-12-stable/contrib/llvm-project/clang/lib/Sema/

Lines Matching defs:SemaRef

42 static bool SubstQualifier(Sema &SemaRef, const DeclT *OldDecl, DeclT *NewDecl,
51 SemaRef,
57 = SemaRef.SubstNestedNameSpecifierLoc(OldDecl->getQualifierLoc(),
69 return ::SubstQualifier(SemaRef, OldDecl, NewDecl, TemplateArgs);
74 return ::SubstQualifier(SemaRef, OldDecl, NewDecl, TemplateArgs);
711 LabelDecl *Inst = LabelDecl::Create(SemaRef.Context, Owner, D->getLocation(),
725 = NamespaceAliasDecl::Create(SemaRef.Context, Owner,
742 DI = SemaRef.SubstType(DI, TemplateArgs,
746 DI = SemaRef.Context.getTrivialTypeSourceInfo(SemaRef.Context.IntTy);
749 SemaRef.MarkDeclarationsReferencedInType(D->getLocation(), DI->getType());
760 RD->getEnclosingNamespaceContext() == SemaRef.getStdNamespace() &&
763 SemaRef.getSourceManager().isInSystemHeader(D->getBeginLoc()))
765 DI = SemaRef.Context.getTrivialTypeSourceInfo(
771 Typedef = TypeAliasDecl::Create(SemaRef.Context, Owner, D->getBeginLoc(),
774 Typedef = TypedefDecl::Create(SemaRef.Context, Owner, D->getBeginLoc(),
791 NamedDecl *InstPrev = SemaRef.FindInstantiatedDecl(D->getLocation(), Prev,
799 SemaRef.isIncompatibleTypedef(InstPrevTypedef, Typedef);
804 SemaRef.InstantiateAttrs(TemplateArgs, D, Typedef);
807 SemaRef.inferGslPointerAttribute(Typedef);
832 LocalInstantiationScope Scope(SemaRef);
855 = TypeAliasTemplateDecl::Create(SemaRef.Context, Owner, D->getLocation(),
872 auto *NewBD = BindingDecl::Create(SemaRef.Context, Owner, D->getLocation(),
875 SemaRef.CurrentInstantiationScope->InstantiatedLocal(D, NewBD);
905 TypeSourceInfo *DI = SemaRef.SubstType(
912 SemaRef.Diag(D->getLocation(), diag::err_variable_instantiates_to_function)
919 SemaRef.adjustContextForLocalExternDecl(DC);
924 Var = DecompositionDecl::Create(SemaRef.Context, DC, D->getInnerLocStart(),
928 Var = VarDecl::Create(SemaRef.Context, DC, D->getInnerLocStart(),
933 if (SemaRef.getLangOpts().ObjCAutoRefCount &&
934 SemaRef.inferObjCARCLifetime(Var))
937 if (SemaRef.getLangOpts().OpenCL)
938 SemaRef.deduceOpenCLAddressSpace(Var);
944 SemaRef.BuildVariableInstantiation(Var, D, TemplateArgs, LateAttrs, Owner,
949 if (SemaRef.isCopyElisionCandidate(ReturnType, Var, Sema::CES_Strict))
956 SemaRef.CheckStaticLocalForDllExport(Var);
963 = AccessSpecDecl::Create(SemaRef.Context, D->getAccess(), Owner,
974 DI = SemaRef.SubstType(DI, TemplateArgs,
986 SemaRef.Diag(D->getLocation(), diag::err_field_instantiates_to_function)
991 SemaRef.MarkDeclarationsReferencedInType(D->getLocation(), DI->getType());
1000 SemaRef, Sema::ExpressionEvaluationContext::ConstantEvaluated);
1003 = SemaRef.SubstExpr(BitWidth, TemplateArgs);
1011 FieldDecl *Field = SemaRef.CheckFieldDecl(D->getDeclName(),
1026 SemaRef.InstantiateAttrs(TemplateArgs, D, Field, LateAttrs, StartingScope);
1029 SemaRef.CheckAlignasUnderalignment(Field);
1036 SemaRef.Context.setInstantiatedFromUnnamedFieldDecl(Field, D);
1041 SemaRef.CurrentInstantiationScope->InstantiatedLocal(D, Field);
1056 SemaRef.Diag(D->getLocation(), diag::err_property_is_variably_modified)
1060 DI = SemaRef.SubstType(DI, TemplateArgs,
1072 SemaRef.Diag(D->getLocation(), diag::err_field_instantiates_to_function)
1077 SemaRef.MarkDeclarationsReferencedInType(D->getLocation(), DI->getType());
1081 SemaRef.Context, Owner, D->getLocation(), D->getDeclName(), DI->getType(),
1084 SemaRef.InstantiateAttrs(TemplateArgs, D, Property, LateAttrs,
1098 new (SemaRef.Context)NamedDecl*[D->getChainingSize()];
1102 NamedDecl *Next = SemaRef.FindInstantiatedDecl(D->getLocation(), PI,
1112 SemaRef.Context, Owner, D->getLocation(), D->getIdentifier(), T,
1116 IndirectField->addAttr(Attr->clone(SemaRef.Context));
1136 InstTy = SemaRef.SubstType(Ty, TemplateArgs,
1142 FriendDecl *FD = SemaRef.CheckFriendTypeDecl(D->getBeginLoc(),
1164 FriendDecl::Create(SemaRef.Context, Owner, D->getLocation(),
1177 SemaRef, Sema::ExpressionEvaluationContext::ConstantEvaluated);
1180 = SemaRef.SubstExpr(AssertExpr, TemplateArgs);
1184 return SemaRef.BuildStaticAssertDeclaration(D->getLocation(),
1194 NamedDecl *Prev = SemaRef.FindInstantiatedDecl(D->getLocation(),
1202 EnumDecl::Create(SemaRef.Context, Owner, D->getBeginLoc(),
1211 TypeSourceInfo *NewTI = SemaRef.SubstType(TI, TemplateArgs, UnderlyingLoc,
1213 if (!NewTI || SemaRef.CheckEnumUnderlyingType(NewTI))
1214 Enum->setIntegerType(SemaRef.Context.IntTy);
1224 SemaRef.InstantiateAttrs(TemplateArgs, D, Enum);
1229 SemaRef.Context.setManglingNumber(Enum, SemaRef.Context.getManglingNumber(D));
1232 if (DeclaratorDecl *DD = SemaRef.Context.getDeclaratorForUnnamedTagDecl(D))
1233 SemaRef.Context.addDeclaratorForUnnamedTagDecl(Enum, DD);
1236 if (TypedefNameDecl *TND = SemaRef.Context.getTypedefNameForUnnamedTagDecl(D))
1237 SemaRef.Context.addTypedefNameForUnnamedTagDecl(Enum, TND);
1249 SemaRef.SubstType(TI->getType(), TemplateArgs,
1251 SemaRef.CheckEnumRedeclaration(Def->getLocation(), Def->isScoped(),
1264 SemaRef.CurrentInstantiationScope->InstantiatedLocal(D, Enum);
1287 SemaRef, Sema::ExpressionEvaluationContext::ConstantEvaluated);
1289 Value = SemaRef.SubstExpr(UninstValue, TemplateArgs);
1300 = SemaRef.CheckEnumConstant(Enum, LastEnumConst,
1311 SemaRef.InstantiateAttrs(TemplateArgs, EC, EnumConst);
1322 SemaRef.CurrentInstantiationScope->InstantiatedLocal(EC, EnumConst);
1327 SemaRef.ActOnEnumBody(Enum->getLocation(), Enum->getBraceRange(), Enum,
1345 LocalInstantiationScope Scope(SemaRef);
1358 QualifierLoc = SemaRef.SubstNestedNameSpecifierLoc(QualifierLoc,
1385 DC = SemaRef.computeDeclContext(SS);
1388 DC = SemaRef.FindInstantiatedContext(Pattern->getLocation(),
1395 LookupResult R(SemaRef, Pattern->getDeclName(), Pattern->getLocation(),
1397 SemaRef.forRedeclarationInCurContext());
1398 SemaRef.LookupQualifiedName(R, DC);
1407 SemaRef.Diag(Pattern->getLocation(), diag::err_not_tag_in_scope)
1441 if (!SemaRef.TemplateParameterListsAreEqual(InstParams, PrevParams,
1454 SemaRef.CheckTemplateParameterList(InstParams, PrevParams,
1461 SemaRef.Context, Pattern->getTagKind(), DC, Pattern->getBeginLoc(),
1468 SemaRef.InstantiateAttrsForDecl(TemplateArgs, Pattern, RecordInst, LateAttrs,
1472 = ClassTemplateDecl::Create(SemaRef.Context, DC, D->getLocation(),
1495 SemaRef.Context.getInjectedClassNameType(RecordInst,
1557 LocalInstantiationScope Scope(SemaRef);
1580 SemaRef.Context, DC, D->getLocation(), D->getIdentifier(), InstParams,
1638 LocalInstantiationScope Scope(SemaRef);
1678 SemaRef.CheckFriendAccess(InstTemplate);
1689 NamedDecl *Prev = SemaRef.FindInstantiatedDecl(D->getLocation(),
1697 SemaRef.Context, D->getTagKind(), Owner, D->getBeginLoc(),
1704 SemaRef.InstantiateAttrsForDecl(TemplateArgs, D, Record, LateAttrs,
1726 SemaRef.CurrentInstantiationScope->InstantiatedLocal(D, Record);
1729 SemaRef.Context.setManglingNumber(Record,
1730 SemaRef.Context.getManglingNumber(D));
1734 if (DeclaratorDecl *DD = SemaRef.Context.getDeclaratorForUnnamedTagDecl(D))
1735 SemaRef.Context.addDeclaratorForUnnamedTagDecl(Record, DD);
1739 if (TypedefNameDecl *TND = SemaRef.Context.getTypedefNameForUnnamedTagDecl(D))
1740 SemaRef.Context.addTypedefNameForUnnamedTagDecl(Record, TND);
1747 Sema::LocalEagerInstantiationScope LocalInstantiations(SemaRef);
1749 SemaRef.InstantiateClass(D->getLocation(), Record, D, TemplateArgs,
1756 SemaRef.InstantiateClassMembers(D->getLocation(), Record, TemplateArgs,
1764 SemaRef.DiagnoseUnusedNestedTypedefs(Record);
1824 LocalInstantiationScope Scope(SemaRef, MergeWithParentScope);
1829 SemaRef, TemplateArgs, DGuide->getExplicitSpecifier(), DGuide);
1838 QualType T = adjustFunctionTypeForInstantiation(SemaRef.Context, D, TInfo);
1851 SemaRef.Context, TemplateParams->getTemplateLoc(),
1859 QualifierLoc = SemaRef.SubstNestedNameSpecifierLoc(QualifierLoc,
1869 SemaRef, Sema::ExpressionEvaluationContext::Unevaluated);
1870 ExprResult SubstRC = SemaRef.SubstExpr(TrailingRequiresClause,
1875 if (!SemaRef.CheckConstraintExpression(TrailingRequiresClause))
1885 SemaRef.adjustContextForLocalExternDecl(DC);
1889 DC = SemaRef.computeDeclContext(SS);
1892 DC = SemaRef.FindInstantiatedContext(D->getLocation(), D->getDeclContext(),
1897 = SemaRef.SubstDeclarationNameInfo(D->getNameInfo(), TemplateArgs);
1905 SemaRef.Context, DC, D->getInnerLocStart(),
1913 SemaRef.Context, DC, D->getInnerLocStart(), NameInfo, T, TInfo,
1961 FunctionTemplate = FunctionTemplateDecl::Create(SemaRef.Context, DC,
1977 TemplateArgumentList::CreateCopy(SemaRef.Context,
1996 SemaRef, Function->getDeclName(), SourceLocation(),
2000 : SemaRef.forRedeclarationInCurContext());
2009 if (SemaRef.Subst(Info->getTemplateArgs(), Info->getNumTemplateArgs(),
2015 Decl *Temp = SemaRef.FindInstantiatedDecl(D->getLocation(),
2023 if (SemaRef.CheckFunctionTemplateSpecialization(Function,
2032 SemaRef.LookupQualifiedName(Previous, DC);
2037 if (SemaRef.Subst(Info->getTemplateArgs(), Info->getNumTemplateArgs(),
2041 if (SemaRef.CheckFunctionTemplateSpecialization(Function,
2051 SemaRef.LookupQualifiedName(Previous, DC);
2061 SemaRef.CheckFunctionDeclaration(/*Scope*/ nullptr, Function, Previous,
2085 SemaRef.CheckForFunctionRedefinition(Function);
2099 SemaRef.PendingLocalImplicitInstantiations.push_back(
2114 SemaRef.CheckTemplateParameterList(
2128 SemaRef.SetDeclDeleted(Function, D->getLocation());
2169 LocalInstantiationScope Scope(SemaRef, MergeWithParentScope);
2186 instantiateExplicitSpecifier(SemaRef, TemplateArgs,
2195 QualType T = adjustFunctionTypeForInstantiation(SemaRef.Context, D, TInfo);
2208 SemaRef.Context, TemplateParams->getTemplateLoc(),
2216 QualifierLoc = SemaRef.SubstNestedNameSpecifierLoc(QualifierLoc,
2226 SemaRef, Sema::ExpressionEvaluationContext::Unevaluated);
2228 Sema::CXXThisScopeRAII ThisScope(SemaRef, ThisContext,
2230 ExprResult SubstRC = SemaRef.SubstExpr(TrailingRequiresClause,
2235 if (!SemaRef.CheckConstraintExpression(TrailingRequiresClause))
2244 DC = SemaRef.computeDeclContext(SS);
2246 if (DC && SemaRef.RequireCompleteDeclContext(SS, DC))
2249 DC = SemaRef.FindInstantiatedContext(D->getLocation(),
2257 = SemaRef.SubstDeclarationNameInfo(D->getNameInfo(), TemplateArgs);
2269 SemaRef.Context, Record, StartLoc, NameInfo, T, TInfo,
2276 SemaRef.Context, Record, StartLoc, NameInfo, T, TInfo,
2282 SemaRef.Context, Record, StartLoc, NameInfo, T, TInfo,
2288 Method = CXXMethodDecl::Create(SemaRef.Context, Record, StartLoc, NameInfo,
2314 FunctionTemplate = FunctionTemplateDecl::Create(SemaRef.Context, Record,
2328 TemplateArgumentList::CreateCopy(SemaRef.Context,
2342 SemaRef.Context,
2358 LookupResult Previous(SemaRef, NameInfo, Sema::LookupOrdinaryName,
2372 if (SemaRef.Subst(Info->getTemplateArgs(), Info->getNumTemplateArgs(),
2378 Decl *Temp = SemaRef.FindInstantiatedDecl(D->getLocation(),
2386 if (SemaRef.CheckFunctionTemplateSpecialization(Method,
2395 SemaRef.LookupQualifiedName(Previous, DC);
2399 if (SemaRef.Subst(Info->getTemplateArgs(), Info->getNumTemplateArgs(),
2403 if (SemaRef.CheckFunctionTemplateSpecialization(Method,
2412 SemaRef.LookupQualifiedName(Previous, DC);
2413 if (SemaRef.CheckFunctionTemplateSpecialization(Method, nullptr, Previous))
2418 SemaRef.LookupQualifiedName(Previous, Record);
2428 SemaRef.CheckFunctionDeclaration(nullptr, Method, Previous,
2432 SemaRef.CheckPureMethod(Method, SourceRange());
2444 SemaRef.CheckOverrideControl(Method);
2452 SemaRef.SetDeclDeleted(Method, Method->getLocation());
2458 SemaRef.CompleteMemberSpecialization(Method, Previous);
2473 SemaRef.CheckFriendAccess(Method);
2494 SemaRef.MarkFunctionReferenced(Loc, Method);
2514 return SemaRef.SubstParmVarDecl(D, TemplateArgs, /*indexAdjustment*/ 0, None,
2535 SemaRef.collectUnexpandedParameterPacks(ArgLoc, Unexpanded);
2541 if (SemaRef.CheckParameterPacksForExpansion(
2554 SemaRef.Context, Owner, D->getBeginLoc(), D->getLocation(),
2576 if (SemaRef.Subst(TemplArgInfo->getTemplateArgs(),
2581 if (SemaRef.AttachTypeConstraint(
2593 SemaRef.SubstType(D->getDefaultArgumentInfo(), TemplateArgs,
2601 SemaRef.CurrentInstantiationScope->InstantiatedLocal(D, Inst);
2624 SemaRef.SubstType(D->getExpansionTypeSourceInfo(I), TemplateArgs,
2630 SemaRef.CheckNonTypeTemplateParameterType(NewDI, D->getLocation());
2648 SemaRef.collectUnexpandedParameterPacks(Pattern, Unexpanded);
2657 if (SemaRef.CheckParameterPacksForExpansion(Expansion.getEllipsisLoc(),
2667 Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(SemaRef, I);
2668 TypeSourceInfo *NewDI = SemaRef.SubstType(Pattern, TemplateArgs,
2675 SemaRef.CheckNonTypeTemplateParameterType(NewDI, D->getLocation());
2692 Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(SemaRef, -1);
2693 TypeSourceInfo *NewPattern = SemaRef.SubstType(Pattern, TemplateArgs,
2699 SemaRef.CheckNonTypeTemplateParameterType(NewPattern, D->getLocation());
2700 DI = SemaRef.CheckPackExpansion(NewPattern, Expansion.getEllipsisLoc(),
2709 DI = SemaRef.SubstType(D->getTypeSourceInfo(), TemplateArgs,
2715 T = SemaRef.CheckNonTypeTemplateParameterType(DI, D->getLocation());
2717 T = SemaRef.Context.IntTy;
2725 SemaRef.Context, Owner, D->getInnerLocStart(), D->getLocation(),
2731 SemaRef.Context, Owner, D->getInnerLocStart(), D->getLocation(),
2737 if (SemaRef.AttachTypeConstraint(
2752 SemaRef, Sema::ExpressionEvaluationContext::ConstantEvaluated);
2753 ExprResult Value = SemaRef.SubstExpr(D->getDefaultArgument(), TemplateArgs);
2760 SemaRef.CurrentInstantiationScope->InstantiatedLocal(D, Param);
2797 LocalInstantiationScope Scope(SemaRef);
2812 collectUnexpandedParameterPacks(SemaRef, D->getTemplateParameters(),
2820 if (SemaRef.CheckParameterPacksForExpansion(D->getLocation(),
2830 Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(SemaRef, I);
2831 LocalInstantiationScope Scope(SemaRef);
2846 Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(SemaRef, -1);
2848 LocalInstantiationScope Scope(SemaRef);
2856 LocalInstantiationScope Scope(SemaRef);
2866 SemaRef.Context, Owner, D->getLocation(),
2871 SemaRef.Context, Owner, D->getLocation(),
2878 SemaRef.SubstNestedNameSpecifierLoc(QualifierLoc, TemplateArgs);
2879 TemplateName TName = SemaRef.SubstTemplateName(
2884 SemaRef.Context,
2894 SemaRef.CurrentInstantiationScope->InstantiatedLocal(D, Param);
2904 = UsingDirectiveDecl::Create(SemaRef.Context, Owner, D->getLocation(),
2930 = SemaRef.SubstNestedNameSpecifierLoc(D->getQualifierLoc(),
2940 if (auto *RD = dyn_cast<CXXRecordDecl>(SemaRef.CurContext))
2941 NameInfo.setName(SemaRef.Context.DeclarationNames.getCXXConstructorName(
2942 SemaRef.Context.getCanonicalType(SemaRef.Context.getRecordType(RD))));
2949 LookupResult Prev(SemaRef, NameInfo, Sema::LookupUsingDeclName,
2952 UsingDecl *NewUD = UsingDecl::Create(SemaRef.Context, Owner,
2962 SemaRef.LookupQualifiedName(Prev, Owner);
2965 if (SemaRef.CheckUsingDeclRedeclaration(D->getUsingLoc(),
2973 SemaRef.CheckUsingDeclQualifier(D->getUsingLoc(), D->hasTypename(),
2977 SemaRef.Context.setInstantiatedFromUsingDecl(NewUD, D);
2986 SemaRef.CheckInheritingConstructorUsingDecl(NewUD);
3000 cast_or_null<NamedDecl>(SemaRef.FindInstantiatedDecl(
3007 if (SemaRef.CheckUsingShadowDecl(NewUD, InstTarget, Prev, PrevDecl))
3011 PrevDecl = cast_or_null<UsingShadowDecl>(SemaRef.FindInstantiatedDecl(
3016 SemaRef.BuildUsingShadowDecl(/*Scope*/nullptr, NewUD, InstTarget,
3018 SemaRef.Context.setInstantiatedFromUsingShadowDecl(InstShadow, Shadow);
3021 SemaRef.CurrentInstantiationScope->InstantiatedLocal(Shadow, InstShadow);
3044 SemaRef.collectUnexpandedParameterPacks(D->getQualifierLoc(), Unexpanded);
3045 SemaRef.collectUnexpandedParameterPacks(D->getNameInfo(), Unexpanded);
3052 if (SemaRef.CheckParameterPacksForExpansion(
3065 Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(SemaRef, -1);
3077 SemaRef.Diag(D->getEllipsisLoc(),
3085 Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(SemaRef, I);
3096 auto *NewD = SemaRef.BuildUsingPackDecl(D, Expansions);
3098 SemaRef.CurrentInstantiationScope->InstantiatedLocal(D, NewD);
3106 = SemaRef.SubstNestedNameSpecifierLoc(D->getQualifierLoc(),
3115 = SemaRef.SubstDeclarationNameInfo(D->getNameInfo(), TemplateArgs);
3120 SemaRef.ArgumentPackSubstitutionIndex != -1;
3124 NamedDecl *UD = SemaRef.BuildUsingDeclaration(
3130 SemaRef.Context.setInstantiatedFromUsingDecl(UD, D);
3149 SemaRef.FindInstantiatedDecl(D->getLocation(), UD, TemplateArgs))
3155 auto *NewD = SemaRef.BuildUsingPackDecl(D, Expansions);
3157 SemaRef.CurrentInstantiationScope->InstantiatedLocal(D, NewD);
3172 Expr *Var = SemaRef.SubstExpr(I, TemplateArgs).get();
3178 SemaRef.CheckOMPThreadPrivateDecl(D->getLocation(), Vars);
3189 Expr *Var = SemaRef.SubstExpr(I, TemplateArgs).get();
3197 ExprResult NewE = SemaRef.SubstExpr(AC->getAllocator(), TemplateArgs);
3200 OMPClause *IC = SemaRef.ActOnOpenMPAllocatorClause(
3205 Sema::DeclGroupPtrTy Res = SemaRef.ActOnOpenMPAllocateDirective(
3226 SubstReductionType = SemaRef.ActOnOpenMPDeclareReductionType(
3228 ParsedType::make(SemaRef.SubstType(
3244 SemaRef.CurrentInstantiationScope->findInstantiationOf(PrevDeclInScope)
3247 auto DRD = SemaRef.ActOnOpenMPDeclareReductionDirectiveStart(
3251 SemaRef.CurrentInstantiationScope->InstantiatedLocal(D, NewDRD);
3256 SemaRef.ActOnOpenMPDeclareReductionCombinerStart(
3258 SemaRef.CurrentInstantiationScope->InstantiatedLocal(
3261 SemaRef.CurrentInstantiationScope->InstantiatedLocal(
3265 Sema::CXXThisScopeRAII ThisScope(SemaRef, ThisContext, Qualifiers(),
3267 SubstCombiner = SemaRef.SubstExpr(Combiner, TemplateArgs).get();
3268 SemaRef.ActOnOpenMPDeclareReductionCombinerEnd(NewDRD, SubstCombiner);
3272 VarDecl *OmpPrivParm = SemaRef.ActOnOpenMPDeclareReductionInitializerStart(
3274 SemaRef.CurrentInstantiationScope->InstantiatedLocal(
3277 SemaRef.CurrentInstantiationScope->InstantiatedLocal(
3281 SubstInitializer = SemaRef.SubstExpr(Init, TemplateArgs).get();
3287 SemaRef.InstantiateVariableInitializer(OmpPrivParm, OldPrivParm,
3290 SemaRef.ActOnOpenMPDeclareReductionInitializerEnd(NewDRD, SubstInitializer,
3300 (void)SemaRef.ActOnOpenMPDeclareReductionDirectiveEnd(
3316 SubstMapperTy = SemaRef.ActOnOpenMPDeclareMapperType(
3318 ParsedType::make(SemaRef.SubstType(D->getType(), TemplateArgs,
3329 SemaRef.CurrentInstantiationScope->findInstantiationOf(PrevDeclInScope)
3332 OMPDeclareMapperDecl *NewDMD = SemaRef.ActOnOpenMPDeclareMapperDirectiveStart(
3335 SemaRef.CurrentInstantiationScope->InstantiatedLocal(D, NewDMD);
3347 SemaRef.StartOpenMPDSABlock(llvm::omp::OMPD_declare_mapper, DirName,
3350 SemaRef.ActOnOpenMPDeclareMapperDirectiveVarDecl(
3352 SemaRef.CurrentInstantiationScope->InstantiatedLocal(
3356 Sema::CXXThisScopeRAII ThisScope(SemaRef, ThisContext, Qualifiers(),
3363 Expr *NE = SemaRef.SubstExpr(OE, TemplateArgs).get();
3373 SemaRef.SubstNestedNameSpecifierLoc(OldC->getMapperQualifierLoc(),
3377 DeclarationNameInfo NewNameInfo = SemaRef.SubstDeclarationNameInfo(
3381 OMPClause *NewC = SemaRef.ActOnOpenMPMapClause(
3387 SemaRef.EndOpenMPDSABlock(nullptr);
3389 (void)SemaRef.ActOnOpenMPDeclareMapperDirectiveEnd(NewDMD, /*S=*/nullptr,
3435 cast_or_null<ClassTemplateDecl>(SemaRef.FindInstantiatedDecl(
3449 if (SemaRef.Subst(ArgLocs.data(), ArgLocs.size(),
3456 if (SemaRef.CheckTemplateArgumentList(InstClassTemplate,
3474 SemaRef.CheckSpecializationInstantiationRedecl(D->getLocation(),
3496 SemaRef.Diag(D->getLocation(), diag::err_redefinition) << PrevDecl;
3497 SemaRef.Diag(PrevDecl->getDefinition()->getLocation(),
3505 SemaRef.Context, D->getTagKind(), Owner, D->getBeginLoc(),
3519 QualType CanonType = SemaRef.Context.getTemplateSpecializationType(
3521 SemaRef.Context.getRecordType(InstD));
3530 TypeSourceInfo *WrittenTy = SemaRef.Context.getTemplateSpecializationTypeInfo(
3548 SemaRef.InstantiateClass(D->getLocation(), InstD, D, TemplateArgs,
3565 cast_or_null<VarTemplateDecl>(SemaRef.FindInstantiatedDecl(
3575 if (SemaRef.Subst(TemplateArgsInfo.getArgumentArray(),
3581 if (SemaRef.CheckTemplateArgumentList(InstVarTemplate, D->getLocation(),
3594 if (PrevDecl && SemaRef.CheckSpecializationInstantiationRedecl(
3612 SemaRef.SubstType(D->getTypeSourceInfo(), TemplateArgs,
3618 SemaRef.Diag(D->getLocation(), diag::err_variable_instantiates_to_function)
3625 SemaRef.Context, Owner, D->getInnerLocStart(), D->getLocation(),
3635 SemaRef.BuildVariableInstantiation(Var, D, TemplateArgs, LateAttrs, Owner,
3647 unsigned DiagID = SemaRef.getDiagnostics().getCustomDiagID(
3650 SemaRef.Diag(D->getLocation(), DiagID)
3662 return RequiresExprBodyDecl::Create(SemaRef.Context, D->getDeclContext(),
3692 T = SemaRef.Context.getFunctionType(
3693 SemaRef.Context.BoolTy, FPT->getParamTypes(), FPT->getExtProtoInfo());
3702 SemaRef.Context.getTrivialTypeSourceInfo(T, Orig->getEndLoc());
3712 SemaRef.Context.DeclarationNames.getCXXOperatorName(OO_EqualEqual));
3780 SemaRef, Sema::ExpressionEvaluationContext::Unevaluated);
3781 ExprResult Res = SemaRef.SubstExpr(E, TemplateArgs);
3789 = TemplateParameterList::Create(SemaRef.Context, L->getTemplateLoc(),
3820 LocalInstantiationScope Scope(SemaRef);
3835 if (SemaRef.Subst(TemplArgInfo->getTemplateArgs(),
3843 if (SemaRef.CheckTemplateArgumentList(ClassTemplate,
3851 if (SemaRef.CheckTemplatePartialSpecializationArgs(
3866 = SemaRef.Context.getTemplateSpecializationType(TemplateName(ClassTemplate),
3877 = SemaRef.Context.getTemplateSpecializationTypeInfo(
3899 SemaRef.Diag(PartialSpec->getLocation(), diag::err_partial_spec_redeclared)
3901 SemaRef.Diag(PrevDecl->getLocation(), diag::note_prev_partial_spec_here)
3902 << SemaRef.Context.getTypeDeclType(PrevDecl);
3910 SemaRef.Context, PartialSpec->getTagKind(), Owner,
3921 SemaRef.CheckTemplatePartialSpecialization(InstPartialSpec);
3948 LocalInstantiationScope Scope(SemaRef);
3963 if (SemaRef.Subst(TemplArgInfo->getTemplateArgs(),
3971 if (SemaRef.CheckTemplateArgumentList(VarTemplate, PartialSpec->getLocation(),
3976 if (SemaRef.CheckTemplatePartialSpecializationArgs(
3989 QualType CanonType = SemaRef.Context.getTemplateSpecializationType(
3999 TypeSourceInfo *WrittenTy = SemaRef.Context.getTemplateSpecializationTypeInfo(
4019 SemaRef.Diag(PartialSpec->getLocation(),
4022 SemaRef.Diag(PrevDecl->getLocation(),
4028 TypeSourceInfo *DI = SemaRef.SubstType(
4035 SemaRef.Diag(PartialSpec->getLocation(),
4044 SemaRef.Context, Owner, PartialSpec->getInnerLocStart(),
4056 SemaRef.CheckTemplatePartialSpecialization(InstPartialSpec);
4062 SemaRef.BuildVariableInstantiation(InstPartialSpec, PartialSpec, TemplateArgs,
4083 = SemaRef.SubstFunctionDeclType(OldTInfo, TemplateArgs,
4100 LocalInstantiationScope *Scope = SemaRef.CurrentInstantiationScope;
4105 SemaRef.getNumArgumentsInExpansion(OldParam->getType(),
4133 Params.push_back(SemaRef.BuildParmVarDeclForTypedef(
4158 if (SemaRef.SubstParmTypes(D->getLocation(), D->parameters(), nullptr,
4329 SemaRef.Context.setManglingNumber(New,
4330 SemaRef.Context.getManglingNumber(Tmpl));
4341 ActiveInstType &ActiveInst = SemaRef.CodeSynthesisContexts.back();
4349 atTemplateEnd(SemaRef.TemplateInstCallbacks, SemaRef, ActiveInst);
4352 atTemplateBegin(SemaRef.TemplateInstCallbacks, SemaRef, ActiveInst);
4366 if (SemaRef.getLangOpts().CPlusPlus11 &&
4386 New->setType(SemaRef.Context.getFunctionType(
4389 Sema::ContextRAII SwitchContext(SemaRef, New);
4390 SemaRef.SubstExceptionSpec(New, Proto, TemplateArgs);
4398 SemaRef.InstantiateAttrs(TemplateArgs, Definition, New,
4415 if (isa<CXXDestructorDecl>(New) && SemaRef.getLangOpts().CPlusPlus11)
4416 SemaRef.AdjustDestructorExceptionSpec(cast<CXXDestructorDecl>(New));
4434 NamedDecl *D = SemaRef.FindInstantiatedDecl(New->getLocation(),
4446 SemaRef.Context, Lookups)
4450 SemaRef.SetDeclDefaulted(New, Tmpl->getLocation());