Lines Matching refs:SemaRef
40 static bool SubstQualifier(Sema &SemaRef, const DeclT *OldDecl, DeclT *NewDecl,
49 SemaRef,
55 = SemaRef.SubstNestedNameSpecifierLoc(OldDecl->getQualifierLoc(),
67 return ::SubstQualifier(SemaRef, OldDecl, NewDecl, TemplateArgs);
72 return ::SubstQualifier(SemaRef, OldDecl, NewDecl, TemplateArgs);
330 LabelDecl *Inst = LabelDecl::Create(SemaRef.Context, Owner, D->getLocation(),
344 = NamespaceAliasDecl::Create(SemaRef.Context, Owner,
361 DI = SemaRef.SubstType(DI, TemplateArgs,
365 DI = SemaRef.Context.getTrivialTypeSourceInfo(SemaRef.Context.IntTy);
368 SemaRef.MarkDeclarationsReferencedInType(D->getLocation(), DI->getType());
379 RD->getEnclosingNamespaceContext() == SemaRef.getStdNamespace() &&
382 SemaRef.getSourceManager().isInSystemHeader(D->getLocStart()))
384 DI = SemaRef.Context.getTrivialTypeSourceInfo(
390 Typedef = TypeAliasDecl::Create(SemaRef.Context, Owner, D->getLocStart(),
393 Typedef = TypedefDecl::Create(SemaRef.Context, Owner, D->getLocStart(),
410 NamedDecl *InstPrev = SemaRef
418 SemaRef.isIncompatibleTypedef(InstPrevTypedef, Typedef);
423 SemaRef.InstantiateAttrs(TemplateArgs, D, Typedef);
448 LocalInstantiationScope Scope(SemaRef);
471 = TypeAliasTemplateDecl::Create(SemaRef.Context, Owner, D->getLocation(),
502 TypeSourceInfo *DI = SemaRef.SubstType(D->getTypeSourceInfo(),
510 SemaRef.Diag(D->getLocation(), diag::err_variable_instantiates_to_function)
517 SemaRef.adjustContextForLocalExternDecl(DC);
520 VarDecl *Var = VarDecl::Create(SemaRef.Context, DC, D->getInnerLocStart(),
525 if (SemaRef.getLangOpts().ObjCAutoRefCount &&
526 SemaRef.inferObjCARCLifetime(Var))
533 SemaRef.BuildVariableInstantiation(Var, D, TemplateArgs, LateAttrs, Owner,
538 if (SemaRef.isCopyElisionCandidate(ReturnType, Var, false))
549 = AccessSpecDecl::Create(SemaRef.Context, D->getAccess(), Owner,
560 DI = SemaRef.SubstType(DI, TemplateArgs,
572 SemaRef.Diag(D->getLocation(), diag::err_field_instantiates_to_function)
577 SemaRef.MarkDeclarationsReferencedInType(D->getLocation(), DI->getType());
585 EnterExpressionEvaluationContext Unevaluated(SemaRef,
589 = SemaRef.SubstExpr(BitWidth, TemplateArgs);
597 FieldDecl *Field = SemaRef.CheckFieldDecl(D->getDeclName(),
612 SemaRef.InstantiateAttrs(TemplateArgs, D, Field, LateAttrs, StartingScope);
615 SemaRef.CheckAlignasUnderalignment(Field);
622 SemaRef.Context.setInstantiatedFromUnnamedFieldDecl(Field, D);
627 SemaRef.CurrentInstantiationScope->InstantiatedLocal(D, Field);
642 SemaRef.Diag(D->getLocation(), diag::err_property_is_variably_modified)
646 DI = SemaRef.SubstType(DI, TemplateArgs,
658 SemaRef.Diag(D->getLocation(), diag::err_field_instantiates_to_function)
663 SemaRef.MarkDeclarationsReferencedInType(D->getLocation(), DI->getType());
667 SemaRef.Context, Owner, D->getLocation(), D->getDeclName(), DI->getType(),
670 SemaRef.InstantiateAttrs(TemplateArgs, D, Property, LateAttrs,
684 new (SemaRef.Context)NamedDecl*[D->getChainingSize()];
688 NamedDecl *Next = SemaRef.FindInstantiatedDecl(D->getLocation(), PI,
698 SemaRef.Context, Owner, D->getLocation(), D->getIdentifier(), T,
702 IndirectField->addAttr(Attr->clone(SemaRef.Context));
722 InstTy = SemaRef.SubstType(Ty, TemplateArgs,
728 FriendDecl *FD = SemaRef.CheckFriendTypeDecl(D->getLocStart(),
750 FriendDecl::Create(SemaRef.Context, Owner, D->getLocation(),
762 EnterExpressionEvaluationContext Unevaluated(SemaRef,
766 = SemaRef.SubstExpr(AssertExpr, TemplateArgs);
770 return SemaRef.BuildStaticAssertDeclaration(D->getLocation(),
780 NamedDecl *Prev = SemaRef.FindInstantiatedDecl(D->getLocation(),
787 EnumDecl *Enum = EnumDecl::Create(SemaRef.Context, Owner, D->getLocStart(),
797 TypeSourceInfo *NewTI = SemaRef.SubstType(TI, TemplateArgs, UnderlyingLoc,
799 if (!NewTI || SemaRef.CheckEnumUnderlyingType(NewTI))
800 Enum->setIntegerType(SemaRef.Context.IntTy);
810 SemaRef.InstantiateAttrs(TemplateArgs, D, Enum);
815 SemaRef.Context.setManglingNumber(Enum, SemaRef.Context.getManglingNumber(D));
818 if (DeclaratorDecl *DD = SemaRef.Context.getDeclaratorForUnnamedTagDecl(D))
819 SemaRef.Context.addDeclaratorForUnnamedTagDecl(Enum, DD);
822 if (TypedefNameDecl *TND = SemaRef.Context.getTypedefNameForUnnamedTagDecl(D))
823 SemaRef.Context.addTypedefNameForUnnamedTagDecl(Enum, TND);
835 SemaRef.SubstType(TI->getType(), TemplateArgs,
837 SemaRef.CheckEnumRedeclaration(Def->getLocation(), Def->isScoped(),
851 SemaRef.CurrentInstantiationScope->InstantiatedLocal(D, Enum);
873 EnterExpressionEvaluationContext Unevaluated(SemaRef,
876 Value = SemaRef.SubstExpr(UninstValue, TemplateArgs);
887 = SemaRef.CheckEnumConstant(Enum, LastEnumConst,
898 SemaRef.InstantiateAttrs(TemplateArgs, EC, EnumConst);
909 SemaRef.CurrentInstantiationScope->InstantiatedLocal(EC, EnumConst);
915 SemaRef.ActOnEnumBody(Enum->getLocation(), SourceLocation(),
935 LocalInstantiationScope Scope(SemaRef);
948 QualifierLoc = SemaRef.SubstNestedNameSpecifierLoc(QualifierLoc,
975 DC = SemaRef.computeDeclContext(SS);
978 DC = SemaRef.FindInstantiatedContext(Pattern->getLocation(),
985 LookupResult R(SemaRef, Pattern->getDeclName(), Pattern->getLocation(),
987 SemaRef.LookupQualifiedName(R, DC);
996 SemaRef.Diag(Pattern->getLocation(), diag::err_not_tag_in_scope)
1030 if (!SemaRef.TemplateParameterListsAreEqual(InstParams, PrevParams,
1043 SemaRef.CheckTemplateParameterList(InstParams, PrevParams,
1050 = CXXRecordDecl::Create(SemaRef.Context, Pattern->getTagKind(), DC,
1059 = ClassTemplateDecl::Create(SemaRef.Context, DC, D->getLocation(),
1080 SemaRef.Context.getInjectedClassNameType(RecordInst,
1142 LocalInstantiationScope Scope(SemaRef);
1165 SemaRef.Context, DC, D->getLocation(), D->getIdentifier(), InstParams,
1223 LocalInstantiationScope Scope(SemaRef);
1263 SemaRef.CheckFriendAccess(InstTemplate);
1274 NamedDecl *Prev = SemaRef.FindInstantiatedDecl(D->getLocation(),
1282 = CXXRecordDecl::Create(SemaRef.Context, D->getTagKind(), Owner,
1309 SemaRef.CurrentInstantiationScope->InstantiatedLocal(D, Record);
1312 SemaRef.Context.setManglingNumber(Record,
1313 SemaRef.Context.getManglingNumber(D));
1317 if (DeclaratorDecl *DD = SemaRef.Context.getDeclaratorForUnnamedTagDecl(D))
1318 SemaRef.Context.addDeclaratorForUnnamedTagDecl(Record, DD);
1322 if (TypedefNameDecl *TND = SemaRef.Context.getTypedefNameForUnnamedTagDecl(D))
1323 SemaRef.Context.addTypedefNameForUnnamedTagDecl(Record, TND);
1331 SavedPendingLocalImplicitInstantiations(SemaRef);
1333 SemaRef.InstantiateClass(D->getLocation(), Record, D, TemplateArgs,
1337 SemaRef.InstantiateClassMembers(D->getLocation(), Record, TemplateArgs,
1342 SemaRef.PerformPendingInstantiations(/*LocalOnly=*/true);
1345 SemaRef.DiagnoseUnusedNestedTypedefs(Record);
1403 LocalInstantiationScope Scope(SemaRef, MergeWithParentScope);
1409 QualType T = adjustFunctionTypeForInstantiation(SemaRef.Context, D, TInfo);
1413 QualifierLoc = SemaRef.SubstNestedNameSpecifierLoc(QualifierLoc,
1425 SemaRef.adjustContextForLocalExternDecl(DC);
1429 DC = SemaRef.computeDeclContext(SS);
1432 DC = SemaRef.FindInstantiatedContext(D->getLocation(), D->getDeclContext(),
1437 FunctionDecl::Create(SemaRef.Context, DC, D->getInnerLocStart(),
1483 FunctionTemplate = FunctionTemplateDecl::Create(SemaRef.Context, DC,
1501 TemplateArgumentList::CreateCopy(SemaRef.Context,
1521 SemaRef, Function->getDeclName(), SourceLocation(),
1536 if (SemaRef.Subst(Info->getTemplateArgs(), Info->getNumTemplateArgs(),
1542 Decl *Temp = SemaRef.FindInstantiatedDecl(D->getLocation(),
1550 if (SemaRef.CheckFunctionTemplateSpecialization(Function,
1561 SemaRef.LookupQualifiedName(Previous, DC);
1571 SemaRef.CheckFunctionDeclaration(/*Scope*/ nullptr, Function, Previous,
1597 SemaRef.Diag(Function->getLocation(), diag::err_redefinition)
1599 SemaRef.Diag(Definition->getLocation(), diag::note_previous_definition);
1615 SemaRef.PendingLocalImplicitInstantiations.push_back(
1628 SemaRef.Diag(Function->getLocation(), diag::err_redefinition)
1630 SemaRef.Diag(R->getLocation(), diag::note_previous_definition);
1679 LocalInstantiationScope Scope(SemaRef, MergeWithParentScope);
1699 QualType T = adjustFunctionTypeForInstantiation(SemaRef.Context, D, TInfo);
1703 QualifierLoc = SemaRef.SubstNestedNameSpecifierLoc(QualifierLoc,
1714 DC = SemaRef.computeDeclContext(SS);
1716 if (DC && SemaRef.RequireCompleteDeclContext(SS, DC))
1719 DC = SemaRef.FindInstantiatedContext(D->getLocation(),
1732 = SemaRef.SubstDeclarationNameInfo(D->getNameInfo(), TemplateArgs);
1734 Method = CXXConstructorDecl::Create(SemaRef.Context, Record,
1751 Sema::InstantiatingTemplate Inst(SemaRef, Constructor->getLocation(),
1755 Sema::ContextRAII SavedContext(SemaRef, Inh->getDeclContext());
1756 LocalInstantiationScope LocalScope(SemaRef);
1763 SemaRef.SubstDecl(Inh, Inh->getDeclContext(), InheritedArgs));
1770 Method = CXXDestructorDecl::Create(SemaRef.Context, Record,
1775 Method = CXXConversionDecl::Create(SemaRef.Context, Record,
1783 Method = CXXMethodDecl::Create(SemaRef.Context, Record,
1809 FunctionTemplate = FunctionTemplateDecl::Create(SemaRef.Context, Record,
1823 TemplateArgumentList::CreateCopy(SemaRef.Context,
1838 SemaRef.Context,
1854 LookupResult Previous(SemaRef, NameInfo, Sema::LookupOrdinaryName,
1858 SemaRef.LookupQualifiedName(Previous, Record);
1869 SemaRef.CheckFunctionDeclaration(nullptr, Method, Previous, false);
1872 SemaRef.CheckPureMethod(Method, SourceRange());
1884 SemaRef.CheckOverrideControl(Method);
1888 SemaRef.SetDeclDefaulted(Method, Method->getLocation());
1890 SemaRef.SetDeclDeleted(Method, Method->getLocation());
1905 SemaRef.CheckFriendAccess(Method);
1932 return SemaRef.SubstParmVarDecl(D, TemplateArgs, /*indexAdjustment*/ 0, None,
1942 TemplateTypeParmDecl::Create(SemaRef.Context, Owner,
1952 SemaRef.SubstType(D->getDefaultArgumentInfo(), TemplateArgs,
1960 SemaRef.CurrentInstantiationScope->InstantiatedLocal(D, Inst);
1982 TypeSourceInfo *NewDI =SemaRef.SubstType(D->getExpansionTypeSourceInfo(I),
1990 QualType NewT =SemaRef.CheckNonTypeTemplateParameterType(NewDI->getType(),
2007 SemaRef.collectUnexpandedParameterPacks(Pattern, Unexpanded);
2016 if (SemaRef.CheckParameterPacksForExpansion(Expansion.getEllipsisLoc(),
2026 Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(SemaRef, I);
2027 TypeSourceInfo *NewDI = SemaRef.SubstType(Pattern, TemplateArgs,
2034 QualType NewT = SemaRef.CheckNonTypeTemplateParameterType(
2051 Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(SemaRef, -1);
2052 TypeSourceInfo *NewPattern = SemaRef.SubstType(Pattern, TemplateArgs,
2058 DI = SemaRef.CheckPackExpansion(NewPattern, Expansion.getEllipsisLoc(),
2067 DI = SemaRef.SubstType(D->getTypeSourceInfo(), TemplateArgs,
2073 SemaRef.CheckNonTypeTemplateParameterType(DI->getType(),
2076 T = SemaRef.Context.IntTy;
2083 Param = NonTypeTemplateParmDecl::Create(SemaRef.Context, Owner,
2094 Param = NonTypeTemplateParmDecl::Create(SemaRef.Context, Owner,
2107 ExprResult Value = SemaRef.SubstExpr(D->getDefaultArgument(), TemplateArgs);
2114 SemaRef.CurrentInstantiationScope->InstantiatedLocal(D, Param);
2151 LocalInstantiationScope Scope(SemaRef);
2166 collectUnexpandedParameterPacks(SemaRef, D->getTemplateParameters(),
2174 if (SemaRef.CheckParameterPacksForExpansion(D->getLocation(),
2184 Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(SemaRef, I);
2185 LocalInstantiationScope Scope(SemaRef);
2200 Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(SemaRef, -1);
2202 LocalInstantiationScope Scope(SemaRef);
2210 LocalInstantiationScope Scope(SemaRef);
2219 Param = TemplateTemplateParmDecl::Create(SemaRef.Context, Owner,
2226 Param = TemplateTemplateParmDecl::Create(SemaRef.Context, Owner,
2236 SemaRef.SubstNestedNameSpecifierLoc(QualifierLoc, TemplateArgs);
2237 TemplateName TName = SemaRef.SubstTemplateName(
2242 SemaRef.Context,
2251 SemaRef.CurrentInstantiationScope->InstantiatedLocal(D, Param);
2261 = UsingDirectiveDecl::Create(SemaRef.Context, Owner, D->getLocation(),
2287 = SemaRef.SubstNestedNameSpecifierLoc(D->getQualifierLoc(),
2301 LookupResult Prev(SemaRef, NameInfo, Sema::LookupUsingDeclName,
2304 UsingDecl *NewUD = UsingDecl::Create(SemaRef.Context, Owner,
2314 SemaRef.LookupQualifiedName(Prev, Owner);
2317 if (SemaRef.CheckUsingDeclRedeclaration(D->getUsingLoc(),
2325 SemaRef.CheckUsingDeclQualifier(D->getUsingLoc(), SS, NameInfo,
2329 SemaRef.Context.setInstantiatedFromUsingDecl(NewUD, D);
2338 SemaRef.CheckInheritingConstructorUsingDecl(NewUD);
2347 cast_or_null<NamedDecl>(SemaRef.FindInstantiatedDecl(
2354 if (SemaRef.CheckUsingShadowDecl(NewUD, InstTarget, Prev, PrevDecl))
2358 PrevDecl = cast_or_null<UsingShadowDecl>(SemaRef.FindInstantiatedDecl(
2363 SemaRef.BuildUsingShadowDecl(/*Scope*/nullptr, NewUD, InstTarget,
2365 SemaRef.Context.setInstantiatedFromUsingShadowDecl(InstShadow, Shadow);
2368 SemaRef.CurrentInstantiationScope->InstantiatedLocal(Shadow, InstShadow);
2382 = SemaRef.SubstNestedNameSpecifierLoc(D->getQualifierLoc(),
2394 SemaRef.BuildUsingDeclaration(/*Scope*/ nullptr, D->getAccess(),
2399 SemaRef.Context.setInstantiatedFromUsingDecl(cast<UsingDecl>(UD), D);
2407 = SemaRef.SubstNestedNameSpecifierLoc(D->getQualifierLoc(), TemplateArgs);
2415 = SemaRef.SubstDeclarationNameInfo(D->getNameInfo(), TemplateArgs);
2418 SemaRef.BuildUsingDeclaration(/*Scope*/ nullptr, D->getAccess(),
2423 SemaRef.Context.setInstantiatedFromUsingDecl(cast<UsingDecl>(UD), D);
2437 LookupResult Previous(SemaRef, NewFD->getNameInfo(), Sema::LookupOrdinaryName,
2447 SemaRef.LookupQualifiedName(Previous, SemaRef.CurContext);
2448 if (SemaRef.CheckFunctionTemplateSpecialization(NewFD, TemplateArgsPtr,
2457 SemaRef.Context.setClassScopeSpecializationPattern(Specialization, OldFD);
2466 Expr *Var = SemaRef.SubstExpr(I, TemplateArgs).get();
2472 SemaRef.CheckOMPThreadPrivateDecl(D->getLocation(), Vars);
2523 if (SemaRef.Subst(ArgLocs.data(), ArgLocs.size(),
2530 if (SemaRef.CheckTemplateArgumentList(InstClassTemplate,
2547 SemaRef.CheckSpecializationInstantiationRedecl(D->getLocation(),
2569 SemaRef.Diag(D->getLocation(), diag::err_redefinition) << PrevDecl;
2570 SemaRef.Diag(PrevDecl->getDefinition()->getLocation(),
2577 = ClassTemplateSpecializationDecl::Create(SemaRef.Context,
2598 QualType CanonType = SemaRef.Context.getTemplateSpecializationType(
2600 SemaRef.Context.getRecordType(InstD));
2609 TypeSourceInfo *WrittenTy = SemaRef.Context.getTemplateSpecializationTypeInfo(
2626 SemaRef.InstantiateClass(D->getLocation(), InstD, D, TemplateArgs,
2647 if (SemaRef.Subst(TemplateArgsInfo.getArgumentArray(),
2653 if (SemaRef.CheckTemplateArgumentList(
2685 SemaRef.SubstType(D->getTypeSourceInfo(), TemplateArgs,
2691 SemaRef.Diag(D->getLocation(), diag::err_variable_instantiates_to_function)
2698 SemaRef.Context, Owner, D->getInnerLocStart(), D->getLocation(),
2709 SemaRef.BuildVariableInstantiation(Var, D, TemplateArgs, LateAttrs,
2721 unsigned DiagID = SemaRef.getDiagnostics().getCustomDiagID(
2724 SemaRef.Diag(D->getLocation(), DiagID)
2769 = TemplateParameterList::Create(SemaRef.Context, L->getTemplateLoc(),
2793 LocalInstantiationScope Scope(SemaRef);
2808 if (SemaRef.Subst(TemplArgInfo->getTemplateArgs(),
2816 if (SemaRef.CheckTemplateArgumentList(ClassTemplate,
2832 = SemaRef.Context.getTemplateSpecializationType(TemplateName(ClassTemplate),
2844 = SemaRef.Context.getTemplateSpecializationTypeInfo(
2866 SemaRef.Diag(PartialSpec->getLocation(), diag::err_partial_spec_redeclared)
2868 SemaRef.Diag(PrevDecl->getLocation(), diag::note_prev_partial_spec_here)
2869 << SemaRef.Context.getTypeDeclType(PrevDecl);
2876 = ClassTemplatePartialSpecializationDecl::Create(SemaRef.Context,
2920 LocalInstantiationScope Scope(SemaRef);
2935 if (SemaRef.Subst(TemplArgInfo->getTemplateArgs(),
2943 if (SemaRef.CheckTemplateArgumentList(VarTemplate, PartialSpec->getLocation(),
2955 QualType CanonType = SemaRef.Context.getTemplateSpecializationType(
2965 TypeSourceInfo *WrittenTy = SemaRef.Context.getTemplateSpecializationTypeInfo(
2985 SemaRef.Diag(PartialSpec->getLocation(),
2988 SemaRef.Diag(PrevDecl->getLocation(),
2994 TypeSourceInfo *DI = SemaRef.SubstType(
3001 SemaRef.Diag(PartialSpec->getLocation(),
3010 SemaRef.Context, Owner, PartialSpec->getInnerLocStart(),
3026 SemaRef.BuildVariableInstantiation(InstPartialSpec, PartialSpec, TemplateArgs,
3047 = SemaRef.SubstFunctionDeclType(OldTInfo, TemplateArgs,
3064 LocalInstantiationScope *Scope = SemaRef.CurrentInstantiationScope;
3069 SemaRef.getNumArgumentsInExpansion(OldParam->getType(),
3097 Params.push_back(SemaRef.BuildParmVarDeclForTypedef(
3121 if (SemaRef.SubstParmTypes(D->getLocation(), D->param_begin(),
3239 SemaRef.Context.setManglingNumber(New,
3240 SemaRef.Context.getManglingNumber(Tmpl));
3251 ActiveInstType &ActiveInst = SemaRef.ActiveTemplateInstantiations.back();
3274 if (SemaRef.getLangOpts().CPlusPlus11 &&
3294 New->setType(SemaRef.Context.getFunctionType(
3297 SemaRef.SubstExceptionSpec(New, Proto, TemplateArgs);
3305 SemaRef.InstantiateAttrs(TemplateArgs, Definition, New,