Lines Matching defs:Specialization
69 // refers to the specified class template specialization,
70 // which could be the current specialization or another
71 // specialization.
107 // template itself and not a specialization thereof, and is not
914 // class template partial specialization, or class template specialization.
982 // In a redeclaration, partial specialization, explicit
983 // specialization or explicit instantiation of a class template,
1082 // If we are providing an explicit specialization of a member that is a
1603 /// declared is an explicit specialization, false otherwise.
1609 /// template specialization), or may be NULL (if what we're declaring isn't
1632 // If we found an explicit specialization that prevents us from needing
1634 // explicit specialization.
1642 // If this type is an explicit specialization, we're done.
1674 // Look one step prior in a dependent template specialization type.
1715 // enclosing class templates. In an explicit specialization for
1734 // Check that we can have an explicit specialization here.
1768 // class templates. In an explicit specialization for such a member, the
1813 // In an explicit specialization declaration for a member of a class
1830 // here, then it's an explicit specialization.
1935 // If there was a specialization somewhere, such that 'template<>' is
1937 // specialization occurred.
1951 // In an explicit specialization declaration for a member of a class
2011 // build a template specialization type for it.
2033 // Find the canonical type for this type alias template specialization.
2061 // This class template specialization is a dependent
2063 // specialization type that contains all of the converted
2118 // Find the class template specialization declaration that
2125 // specialization. Create the canonical declaration and add it to
2140 // Diagnose uses of this specialization.
2145 "type of non-dependent specialization is not a RecordType");
2149 // specialization, which refers back to the class template
2150 // specialization we created or found.
2267 // resolves to an alias template specialization, the
2293 // Provide source-location information for the template specialization.
2404 "Variable template specialization is declared with a template it.");
2444 // Check that the type of this variable template specialization
2463 // Find the variable template (partial) specialization declaration that
2485 // -- The argument list of the specialization shall not be identical
2506 VarTemplateSpecializationDecl *Specialization = nullptr;
2508 // Check whether we can declare a variable template specialization in
2516 // Since the only prior variable template specialization with these
2520 Specialization = PrevDecl;
2521 Specialization->setLocation(TemplateNameLoc);
2524 // Create a new class template partial specialization declaration node.
2535 Specialization = Partial;
2537 // If we are providing an explicit specialization of a member variable
2538 // template specialization, make a note of that.
2543 // partial specialization are deducible from the template
2544 // arguments. If not, this variable template partial specialization
2569 // Create a new class template specialization declaration node for
2570 // this explicit specialization or friend declaration.
2571 Specialization = VarTemplateSpecializationDecl::Create(
2574 Specialization->setTemplateArgsInfo(TemplateArgs);
2577 VarTemplate->AddSpecialization(Specialization, InsertPos);
2582 // explicitly specialized then that specialization shall be declared
2583 // before the first use of that specialization that would cause an implicit
2589 // Is there any previous explicit specialization declaration?
2609 Specialization->setTemplateKeywordLoc(TemplateKWLoc);
2610 Specialization->setLexicalDeclContext(CurContext);
2612 // Add the specialization into its lexical context, so that it can
2615 CurContext->addDecl(Specialization);
2617 // Note that this is an explicit specialization.
2618 Specialization->setSpecializationKind(TSK_ExplicitSpecialization);
2621 // Check that this isn't a redefinition of this specialization,
2626 D.setRedeclaration(CheckVariableDeclaration(Specialization, PrevSpec));
2627 } else if (Specialization->isStaticDataMember() &&
2628 Specialization->isOutOfLine()) {
2629 Specialization->setAccess(VarTemplate->getAccess());
2634 if (Specialization->isStaticDataMember())
2635 Specialization->setInstantiationOfStaticDataMember(
2637 Specialization->getSpecializationKind());
2639 return Specialization;
2643 /// \brief A partial specialization whose template arguments have matched
2665 // Find the variable template specialization declaration that
2670 // If we already have a variable template specialization, return it.
2674 // specialization. Create the canonical declaration and add it to
2675 // the set of specializations, based on the closest partial specialization
2687 // 1. Attempt to find the closest partial specialization that this
2724 // -- If exactly one matching specialization is found, the
2725 // instantiation is generated from that specialization.
2728 // -- If more than one matching specialization is found, the
2744 // Determine if the best partial specialization is more specialized than
2758 // Instantiate using the best variable template partial specialization.
2798 assert(Decl && "No variable template specialization?");
5601 /// \brief Determine what kind of template specialization the given declaration
5617 /// \brief Check whether a specialization is well-formed in the current
5620 specialization can be declared
5633 /// \param Loc the location of the explicit specialization or instantiation of
5636 /// \param IsPartialSpecialization whether this is a partial specialization of
5671 // An explicit specialization shall be declared in the namespace
5674 // template is a member. An explicit specialization of a member
5679 // specialization may be defined later in the name- space in which
5680 // the explicit specialization was declared, or in a namespace
5681 // that encloses the one in which the explicit specialization was
5691 // Do not warn for class scope explicit specialization during
5714 // A class template partial specialization may be declared or redeclared
5741 llvm_unreachable("unexpected namespace context for specialization");
5749 // An explicit specialization shall be declared in the namespace of which
5752 // An explicit specialization of a member function, member class or
5757 // An explicit specialization shall be declared in a namespace enclosing
5809 /// that checks non-type template partial specialization arguments.
5850 // specialization, the following restrictions apply:
5853 // specialization except when the argument expression is a
5874 // parameter of the specialization.
5900 /// partial specialization according to C++ [temp.class.spec]p9.
5907 /// partial specialization.
5988 // The template parameter list of a specialization shall not
6029 // Check that the specialization uses the same tag kind as the
6062 // Find the class template (partial) specialization declaration that
6091 ClassTemplateSpecializationDecl *Specialization = nullptr;
6093 // Check whether we can declare a class template specialization in
6105 // arguments of the class template partial specialization.
6115 // -- The argument list of the specialization shall not be identical
6130 // Create a new class template partial specialization declaration node.
6153 Specialization = Partial;
6155 // If we are providing an explicit specialization of a member class
6156 // template specialization, make a note of that.
6161 // partial specialization are deducible from the template
6162 // arguments. If not, this class template partial specialization
6189 // Create a new class template specialization declaration node for
6190 // this explicit specialization or friend declaration.
6191 Specialization
6199 SetNestedNameSpecifier(Specialization, SS);
6201 Specialization->setTemplateParameterListsInfo(Context,
6207 ClassTemplate->AddSpecialization(Specialization, InsertPos);
6209 CanonType = Context.getTypeDeclType(Specialization);
6214 // explicitly specialized then that specialization shall be declared
6215 // before the first use of that specialization that would cause an implicit
6221 // Is there any previous explicit specialization declaration?
6231 << Context.getTypeDeclType(Specialization) << Range;
6241 // If this is not a friend, note that this is an explicit specialization.
6243 Specialization->setSpecializationKind(TSK_ExplicitSpecialization);
6245 // Check that this isn't a redefinition of this specialization.
6247 if (RecordDecl *Def = Specialization->getDefinition()) {
6250 << Context.getTypeDeclType(Specialization) << Range;
6252 Specialization->setInvalidDecl();
6258 ProcessDeclAttributeList(S, Specialization, Attr);
6263 AddAlignmentAttributesForRecord(Specialization);
6264 AddMsStructLayoutForRecord(Specialization);
6268 Diag(Specialization->getLocation(), diag::err_module_private_specialization)
6273 // specialization as the user wrote in the specialization
6275 // from the specialization's declaration the way that the user
6276 // actually wrote the specialization, rather than formatting the
6278 // template arguments in the specialization.
6283 Specialization->setTypeAsWritten(WrittenTy);
6284 Specialization->setTemplateKeywordLoc(TemplateKWLoc);
6288 // A template explicit specialization is in the scope of the
6295 Specialization->setLexicalDeclContext(CurContext);
6297 // We may be starting the definition of this specialization.
6299 Specialization->startDefinition();
6309 // Add the specialization into its lexical context, so that it can
6312 CurContext->addDecl(Specialization);
6314 return Specialization;
6360 // Explicit instantiations following a specialization have no effect and
6373 /// \brief Diagnose cases where we have an explicit template specialization
6376 /// new specialization/instantiation will have any effect.
6378 /// \param NewLoc the location of the new explicit specialization or
6381 /// \param NewTSK the kind of the new explicit specialization or instantiation.
6385 /// \param PrevTSK the kind of the old explicit specialization or instantiatin.
6391 /// specialization or instantiation has no effect and should be ignored.
6438 // is explicitly specialized then that specialization shall be declared
6439 // before the first use of that specialization that would cause an
6443 // Is there any previous explicit specialization declaration?
6473 // specialization for that template, the explicit instantiation has no
6486 // Explicit instantiations following a specialization have no effect and
6507 // an explicit specialization for that template, the explicit
6529 // specialization for that template, the explicit instantiation has no
6532 // Is there any previous explicit specialization declaration?
6559 llvm_unreachable("Missing specialization/instantiation case?");
6563 /// template specialization.
6565 /// The only possible way to get a dependent function template specialization
6603 /// specialization.
6606 /// explicit function template specialization. On successful completion,
6608 /// specialization.
6611 /// function template specialization.
6619 /// this function specialization.
6624 // explicit function template specialization.
6639 // When matching a constexpr member function template specialization
6641 // specialization has an implicit 'const' (because we don't know whether
6659 // template-id naming an explicit function template specialization
6665 FunctionDecl *Specialization = nullptr;
6668 ExplicitTemplateArgs, FT, Specialization, Info)) {
6679 Candidates.addDecl(Specialization, I.getAccess());
6696 FunctionDecl *Specialization = cast<FunctionDecl>(*Result);
6699 = Specialization->getTemplateSpecializationInfo();
6700 assert(SpecInfo && "Function template specialization info missing?");
6703 // specialization kind was explicit.
6706 Specialization->setLocation(FD->getLocation());
6707 // C++11 [dcl.constexpr]p1: An explicit specialization of a constexpr
6710 Specialization->setConstexpr(FD->isConstexpr());
6713 // FIXME: Check if the prior specialization has a point of instantiation.
6717 // an explicit specialization.
6720 // Check the scope of this explicit specialization.
6723 Specialization->getPrimaryTemplate(),
6724 Specialization, FD->getLocation(),
6730 // explicitly specialized then that specialization shall be declared
6731 // before the first use of that specialization that would cause an implicit
6738 Specialization,
6744 // Mark the prior declaration as an explicit specialization, so that later
6745 // clients know that this is an explicit specialization.
6748 MarkUnusedFileScopedDecl(Specialization);
6752 // specialization, with the template arguments from the previous
6753 // specialization.
6756 TemplateArgumentList(Specialization->getTemplateSpecializationArgs());
6757 FD->setFunctionTemplateSpecialization(Specialization->getPrimaryTemplate(),
6762 // The "previous declaration" for this function template specialization is
6763 // the prior function template specialization.
6765 Previous.addDecl(Specialization);
6770 /// specialization.
6773 /// explicit member function specialization. On successful completion,
6775 /// specialization.
6778 /// specialization.
6781 /// by this function specialization; the set will be modified to contain the
6863 // Make sure that this is a specialization of a member.
6873 // explicitly specialized then that specialization shall be declared
6874 // before the first use of that specialization that would cause an implicit
6877 assert(MSInfo && "Member specialization info missing?");
6888 // Check the scope of this explicit specialization.
6896 // the original declaration to note that it is an explicit specialization
6951 // this specialization matches.
7018 // or a static data member of a class template specialization, the name of
7019 // the class template specialization in the qualified-id for the member
7032 // Explicit instantiation of a class template specialization
7049 // Check that the specialization uses the same tag kind as the
7095 // Find the class template specialization declaration that
7113 ClassTemplateSpecializationDecl *Specialization = nullptr;
7128 // Since the only prior class template specialization with these
7133 Specialization = PrevDecl;
7134 Specialization->setLocation(TemplateNameLoc);
7139 if (!Specialization) {
7140 // Create a new class template specialization declaration node for
7141 // this explicit specialization.
7142 Specialization
7150 SetNestedNameSpecifier(Specialization, SS);
7153 // Insert the new specialization.
7154 ClassTemplate->AddSpecialization(Specialization, InsertPos);
7161 // specialization's declaration the way that the user actually wrote
7164 // arguments in the specialization.
7168 Context.getTypeDeclType(Specialization));
7169 Specialization->setTypeAsWritten(WrittenTy);
7172 Specialization->setExternLoc(ExternLoc);
7173 Specialization->setTemplateKeywordLoc(TemplateLoc);
7174 Specialization->setRBraceLoc(SourceLocation());
7177 ProcessDeclAttributeList(S, Specialization, Attr);
7182 Specialization->setLexicalDeclContext(CurContext);
7183 CurContext->addDecl(Specialization);
7187 // Set the template specialization kind.
7188 Specialization->setTemplateSpecializationKind(TSK);
7189 return Specialization;
7201 Specialization->getDefinition());
7203 InstantiateClassTemplateSpecialization(TemplateNameLoc, Specialization, TSK);
7205 MarkVTableUsed(TemplateNameLoc, Specialization, true);
7206 Specialization->setPointOfInstantiation(Def->getPointOfInstantiation());
7209 // Instantiate the members of this class template specialization.
7211 Specialization->getDefinition());
7225 // Set the template specialization kind.
7226 Specialization->setTemplateSpecializationKind(TSK);
7227 return Specialization;
7303 assert(MSInfo && "No member specialization information?");
7434 // A [...] variable [...] template specialization can be explicitly
7454 // FIXME: Check for explicit specialization?
7504 // or a static data member of a class template specialization, the name of
7505 // the class template specialization in the qualified-id for the member
7541 // Check the new variable specialization against the parsed input.
7592 FunctionDecl *Specialization = nullptr;
7597 R, Specialization, Info)) {
7606 Matches.addDecl(Specialization, P.getAccess());
7609 // Find the most specialized function template specialization.
7621 FunctionDecl *Specialization = cast<FunctionDecl>(*Result);
7623 if (Specialization->getTemplateSpecializationKind() == TSK_Undeclared) {
7626 << Specialization
7627 << (Specialization->getTemplateSpecializationKind() ==
7629 Diag(Specialization->getLocation(), diag::note_explicit_instantiation_here);
7633 FunctionDecl *PrevDecl = Specialization->getPreviousDecl();
7634 if (!PrevDecl && Specialization->isThisDeclarationADefinition())
7635 PrevDecl = Specialization;
7647 // explicit specialization.
7652 Specialization->setTemplateSpecializationKind(TSK, D.getIdentifierLoc());
7655 ProcessDeclAttributeList(S, Specialization, Attr);
7657 if (Specialization->isDefined()) {
7660 Consumer.HandleTopLevelDecl(DeclGroupRef(Specialization));
7662 InstantiateFunctionDefinition(D.getIdentifierLoc(), Specialization);
7666 // or a static data member of a class template specialization, the name of
7667 // the class template specialization in the qualified-id for the member
7671 FunctionTemplateDecl *FunTmpl = Specialization->getPrimaryTemplate();
7677 << Specialization << D.getCXXScopeSpec().getRange();
7681 : Specialization->getInstantiatedFromMemberFunction(),
7780 // Construct a dependent template specialization type.
7807 // Provide source-location information for the template specialization type.
7836 // ... within an explicitly-written template specialization...
8019 /// a class template (or class template partial specialization) that was parsed
8021 /// partial specialization thereof). This routine will rebuild that type now