Lines Matching full:instantiation

1 //===------- SemaTemplateInstantiate.cpp - C++ Template Instantiation ------===/
8 // This file implements C++ template instantiation.
50 // Template Instantiation Support
173 // Add template arguments from a variable template instantiation.
235 // Add template arguments from a class template instantiation.
281 // This is an implicit instantiation of an explicit specialization. We
587 // Don't allow further instantiation if a fatal error and an uncompilable
831 "forgot to remove a lookup module for a template instantiation");
913 // Skip this instantiation?
1259 // An instantiation of an alias template may or may not be a SFINAE
1271 // This is a template instantiation, so there is no SFINAE.
1285 // A default template argument instantiation and substitution into
1310 // This happens in a context unrelated to template instantiation, so
1325 // non-instantiation SFINAE context, then SFINAE applies.
1334 // Template Instantiation for Types
1363 /// For the purposes of template instantiation, a type has already been
1461 // operator template of a generic lambda, update the "instantiation of"
1692 // instantiation of the lambda expression, causing the instantiation
1817 // because we are performing instantiation from explicitly-specified
1964 // because we are performing instantiation from explicitly-specified
2047 // because we are performing instantiation from explicitly-specified
2211 // Find the instantiation of the template argument. This is
2324 // parameters in the instantiation of the function decl.
2348 assert(Found && "no instantiation for parameter pack");
2384 // FindInstantiatedDecl will find it in the local instantiation scope.
2411 // We need a local instantiation scope for this function prototype.
2448 // TODO: only do this uniquing once, at the start of instantiation.
2467 // because we are performing instantiation from explicitly-specified
2797 "Cannot perform an instantiation without some context on the "
2798 "instantiation stack");
2814 "Cannot perform an instantiation without some context on the "
2815 "instantiation stack");
2844 "Cannot perform an instantiation without some context on the "
2845 "instantiation stack");
2886 "Cannot perform an instantiation without some context on the "
2887 "instantiation stack");
3197 "Cannot perform an instantiation without some context on the "
3198 "instantiation stack");
3238 // an instantiation scope that includes the parameters of the callee is
3298 Sema::SubstBaseSpecifiers(CXXRecordDecl *Instantiation,
3307 Instantiation->setInvalidDecl();
3349 = CheckBaseSpecifier(Instantiation,
3383 = CheckBaseSpecifier(Instantiation,
3394 if (!Invalid && AttachBaseSpecifiers(Instantiation, InstantiatedBases))
3413 CXXRecordDecl *Instantiation, CXXRecordDecl *Pattern,
3419 if (DiagnoseUninstantiableTemplate(PointOfInstantiation, Instantiation,
3420 Instantiation->getInstantiatedFromMemberClass(),
3427 Instantiation->getNameForDiagnostic(OS, getPrintingPolicy(),
3430 auto Loc = SourceMgr.getExpansionLoc(Instantiation->getLocation());
3439 // Record the point of instantiation.
3441 = Instantiation->getMemberSpecializationInfo()) {
3445 = dyn_cast<ClassTemplateSpecializationDecl>(Instantiation)) {
3450 InstantiatingTemplate Inst(*this, PointOfInstantiation, Instantiation);
3454 PrettyDeclStackTraceEntry CrashInfo(Context, Instantiation, SourceLocation(),
3457 // Enter the scope of this instantiation. We don't use
3459 ContextRAII SavedContext(*this, Instantiation);
3463 // If this is an instantiation of a local class, merge this local
3464 // instantiation scope with the enclosing scope. Otherwise, every
3465 // instantiation of a class has its own local instantiation scope.
3466 bool MergeWithParentScope = !Instantiation->isDefinedOutsideFunctionOrMethod();
3470 // instantiation completes. We may not be ready to handle any delayed state
3475 // Pull attributes from the pattern onto the instantiation.
3476 InstantiateAttrs(TemplateArgs, Pattern, Instantiation);
3478 // Start the definition of this instantiation.
3479 Instantiation->startDefinition();
3481 // The instantiation is visible here, even if it was first declared in an
3483 Instantiation->setVisibleDespiteOwningModule();
3485 // FIXME: This loses the as-written tag kind for an explicit instantiation.
3486 Instantiation->setTagKind(Pattern->getTagKind());
3489 if (SubstBaseSpecifiers(Instantiation, Pattern, TemplateArgs))
3490 Instantiation->setInvalidDecl();
3492 TemplateDeclInstantiator Instantiator(*this, Instantiation, TemplateArgs);
3495 // Delay instantiation of late parsed attributes.
3522 Instantiation->setInvalidDecl();
3531 // C++11 [temp.inst]p1: The implicit instantiation of a class template
3532 // specialization causes the implicit instantiation of the definitions
3534 // Record a point of instantiation for this implicit instantiation.
3546 Instantiation->setInvalidDecl();
3551 (MD->isVirtualAsWritten() || Instantiation->getNumBases()))
3556 Instantiation->setInvalidDecl();
3566 ActOnFields(nullptr, Instantiation->getLocation(), Instantiation, Fields,
3568 CheckCompletedCXXClass(nullptr, Instantiation);
3599 ActOnFinishDelayedMemberInitializers(Instantiation);
3604 Instantiation->setLocation(Pattern->getLocation());
3605 Instantiation->setLocStart(Pattern->getInnerLocStart());
3606 Instantiation->setBraceRange(Pattern->getBraceRange());
3609 if (!Instantiation->isInvalidDecl()) {
3622 Instantiation->setInvalidDecl();
3635 Instantiation->setInvalidDecl();
3641 // Exit the scope of this instantiation.
3644 if (!Instantiation->isInvalidDecl()) {
3645 // Always emit the vtable for an explicit instantiation definition
3650 MarkVTableUsed(PointOfInstantiation, Instantiation, true);
3652 MarkVirtualMembersReferenced(PointOfInstantiation, Instantiation,
3656 Consumer.HandleTagDeclDefinition(Instantiation);
3658 return Instantiation->isInvalidDecl();
3662 EnumDecl *Instantiation, EnumDecl *Pattern,
3666 if (DiagnoseUninstantiableTemplate(PointOfInstantiation, Instantiation,
3667 Instantiation->getInstantiatedFromMemberEnum(),
3672 // Record the point of instantiation.
3674 = Instantiation->getMemberSpecializationInfo()) {
3679 InstantiatingTemplate Inst(*this, PointOfInstantiation, Instantiation);
3684 PrettyDeclStackTraceEntry CrashInfo(Context, Instantiation, SourceLocation(),
3687 // The instantiation is visible here, even if it was first declared in an
3689 Instantiation->setVisibleDespiteOwningModule();
3691 // Enter the scope of this instantiation. We don't use
3693 ContextRAII SavedContext(*this, Instantiation);
3699 // Pull attributes from the pattern onto the instantiation.
3700 InstantiateAttrs(TemplateArgs, Pattern, Instantiation);
3702 TemplateDeclInstantiator Instantiator(*this, Instantiation, TemplateArgs);
3703 Instantiator.InstantiateEnumDefinition(Instantiation, Pattern);
3705 // Exit the scope of this instantiation.
3708 return Instantiation->isInvalidDecl();
3712 SourceLocation PointOfInstantiation, FieldDecl *Instantiation,
3718 assert(Instantiation->getInClassInitStyle() ==
3720 "pattern and instantiation disagree about init style");
3733 Instantiation->setInvalidDecl();
3737 InstantiatingTemplate Inst(*this, PointOfInstantiation, Instantiation);
3741 // Error out if we hit an instantiation cycle for this initializer.
3743 << Instantiation;
3746 PrettyDeclStackTraceEntry CrashInfo(Context, Instantiation, SourceLocation(),
3749 // Enter the scope of this instantiation. We don't use PushDeclContext because
3751 ContextRAII SavedContext(*this, Instantiation->getParent());
3755 PointOfInstantiation, Instantiation, CurContext};
3761 CXXThisScopeRAII ThisScope(*this, Instantiation->getParent(), Qualifiers());
3768 Instantiation, Init ? Init->getBeginLoc() : SourceLocation(), Init);
3771 L->DefaultMemberInitializerInstantiated(Instantiation);
3774 return !Instantiation->getInClassInitializer();
3806 /// Get the instantiation pattern to use to instantiate the definition of a
3829 // instantiation of the class, it is necessary to determine
3830 // whether the instantiation is to be generated using the primary
3867 // instantiation is generated from that specialization.
3922 // -- If no matches are found, the instantiation is generated
3961 // Perform the actual instantiation on the canonical declaration.
3980 CXXRecordDecl *Instantiation,
3984 // things, in case we have an explicit instantiation definition in a PCM, a
3989 (TSK == TSK_ImplicitInstantiation && Instantiation->isLocalClass())) &&
3991 for (auto *D : Instantiation->decls()) {
4027 // An explicit instantiation definition that names a class template
4029 // specialization and is only an explicit instantiation definition
4031 // instantiation.
4072 // An explicit instantiation definition that names a class template
4074 // specialization and is only an explicit instantiation definition
4076 // instantiation.
4108 // On Windows, explicit instantiation decl of the outer class doesn't
4131 // An explicit instantiation definition that names a class template
4133 // specialization and is only an explicit instantiation definition
4135 // instantiation.
4192 // instantiation.
4195 Instantiation->getTemplateInstantiationPattern();
4213 // An explicit instantiation that names a class template
4218 // containing the explicit instantiation, except as described
4336 // When storing ParmVarDecls in the local instantiation scope, we always
4385 // Local types referenced prior to definition may require instantiation.
4396 // instantiation.
4442 "Creating local pack after instantiation of local");