Home | History | Annotate | Download | only in Sema

Lines Matching refs:Specialization

70     //   refers to the specified class template specialization,
71 // which could be the current specialization or another
72 // specialization.
108 // template itself and not a specialization thereof, and is not
924 // class template partial specialization, or class template specialization.
1007 // In a redeclaration, partial specialization, explicit
1008 // specialization or explicit instantiation of a class template,
1120 // If we are providing an explicit specialization of a member that is a
1633 /// declared is an explicit specialization, false otherwise.
1639 /// template specialization), or may be NULL (if what we're declaring isn't
1662 // If we found an explicit specialization that prevents us from needing
1664 // explicit specialization.
1672 // If this type is an explicit specialization, we're done.
1704 // Look one step prior in a dependent template specialization type.
1745 // enclosing class templates. In an explicit specialization for
1764 // Check that we can have an explicit specialization here.
1798 // class templates. In an explicit specialization for such a member, the
1843 // In an explicit specialization declaration for a member of a class
1860 // here, then it's an explicit specialization.
1965 // If there was a specialization somewhere, such that 'template<>' is
1967 // specialization occurred.
1981 // In an explicit specialization declaration for a member of a class
2093 // build a template specialization type for it.
2115 // Find the canonical type for this type alias template specialization.
2143 // This class template specialization is a dependent
2145 // specialization type that contains all of the converted
2200 // Find the class template specialization declaration that
2207 // specialization. Create the canonical declaration and add it to
2222 // Diagnose uses of this specialization.
2227 "type of non-dependent specialization is not a RecordType");
2234 // specialization, which refers back to the class template
2235 // specialization we created or found.
2352 // resolves to an alias template specialization, the
2378 // Provide source-location information for the template specialization.
2489 "Variable template specialization is declared with a template it.");
2529 // Find the variable template (partial) specialization declaration that
2551 // -- The argument list of the specialization shall not be identical
2572 VarTemplateSpecializationDecl *Specialization = nullptr;
2574 // Check whether we can declare a variable template specialization in
2582 // Since the only prior variable template specialization with these
2586 Specialization = PrevDecl;
2587 Specialization->setLocation(TemplateNameLoc);
2590 // Create a new class template partial specialization declaration node.
2601 Specialization = Partial;
2603 // If we are providing an explicit specialization of a member variable
2604 // template specialization, make a note of that.
2609 // partial specialization are deducible from the template
2610 // arguments. If not, this variable template partial specialization
2635 // Create a new class template specialization declaration node for
2636 // this explicit specialization or friend declaration.
2637 Specialization = VarTemplateSpecializationDecl::Create(
2640 Specialization->setTemplateArgsInfo(TemplateArgs);
2643 VarTemplate->AddSpecialization(Specialization, InsertPos);
2648 // explicitly specialized then that specialization shall be declared
2649 // before the first use of that specialization that would cause an implicit
2655 // Is there any previous explicit specialization declaration?
2675 Specialization->setTemplateKeywordLoc(TemplateKWLoc);
2676 Specialization->setLexicalDeclContext(CurContext);
2678 // Add the specialization into its lexical context, so that it can
2681 CurContext->addDecl(Specialization);
2683 // Note that this is an explicit specialization.
2684 Specialization->setSpecializationKind(TSK_ExplicitSpecialization);
2687 // Check that this isn't a redefinition of this specialization,
2692 D.setRedeclaration(CheckVariableDeclaration(Specialization, PrevSpec));
2693 } else if (Specialization->isStaticDataMember() &&
2694 Specialization->isOutOfLine()) {
2695 Specialization->setAccess(VarTemplate->getAccess());
2700 if (Specialization->isStaticDataMember())
2701 Specialization->setInstantiationOfStaticDataMember(
2703 Specialization->getSpecializationKind());
2705 return Specialization;
2709 /// \brief A partial specialization whose template arguments have matched
2731 // Find the variable template specialization declaration that
2736 // If we already have a variable template specialization, return it.
2740 // specialization. Create the canonical declaration and add it to
2741 // the set of specializations, based on the closest partial specialization
2754 // 1. Attempt to find the closest partial specialization that this
2791 // -- If exactly one matching specialization is found, the
2792 // instantiation is generated from that specialization.
2795 // -- If more than one matching specialization is found, the
2811 // Determine if the best partial specialization is more specialized than
2825 // Instantiate using the best variable template partial specialization.
2865 assert(Decl && "No variable template specialization?");
5802 /// \brief Determine what kind of template specialization the given declaration
5818 /// \brief Check whether a specialization is well-formed in the current
5821 /// This routine determines whether a template specialization can be declared
5834 /// \param Loc the location of the explicit specialization or instantiation of
5837 /// \param IsPartialSpecialization whether this is a partial specialization of
5872 // An explicit specialization shall be declared in the namespace
5875 // template is a member. An explicit specialization of a member
5880 // specialization may be defined later in the name- space in which
5881 // the explicit specialization was declared, or in a namespace
5882 // that encloses the one in which the explicit specialization was
5892 // Do not warn for class scope explicit specialization during
5915 // A class template partial specialization may be declared or redeclared
5944 llvm_unreachable("unexpected namespace context for specialization");
5952 // An explicit specialization shall be declared in the namespace of which
5955 // An explicit specialization of a member function, member class or
5960 // An explicit specialization shall be declared in a namespace enclosing
6012 /// that checks non-type template partial specialization arguments.
6053 // specialization, the following restrictions apply:
6056 // specialization except when the argument expression is a
6077 // parameter of the specialization.
6103 /// partial specialization according to C++ [temp.class.spec]p9.
6110 /// partial specialization.
6193 // The template parameter list of a specialization shall not
6234 // Check that the specialization uses the same tag kind as the
6267 // Find the class template (partial) specialization declaration that
6296 ClassTemplateSpecializationDecl *Specialization = nullptr;
6298 // Check whether we can declare a class template specialization in
6310 // arguments of the class template partial specialization.
6320 // -- The argument list of the specialization shall not be identical
6336 // Create a new class template partial specialization declaration node.
6358 Specialization = Partial;
6360 // If we are providing an explicit specialization of a member class
6361 // template specialization, make a note of that.
6366 // partial specialization are deducible from the template
6367 // arguments. If not, this class template partial specialization
6394 // Create a new class template specialization declaration node for
6395 // this explicit specialization or friend declaration.
6396 Specialization
6404 SetNestedNameSpecifier(Specialization, SS);
6406 Specialization->setTemplateParameterListsInfo(Context,
6411 ClassTemplate->AddSpecialization(Specialization, InsertPos);
6414 // -fms-extensions permits specialization of nested classes without
6422 CanonType = Context.getTypeDeclType(Specialization);
6428 // explicitly specialized then that specialization shall be declared
6429 // before the first use of that specialization that would cause an implicit
6435 // Is there any previous explicit specialization declaration?
6445 << Context.getTypeDeclType(Specialization) << Range;
6455 // If this is not a friend, note that this is an explicit specialization.
6457 Specialization->setSpecializationKind(TSK_ExplicitSpecialization);
6459 // Check that this isn't a redefinition of this specialization.
6461 RecordDecl *Def = Specialization->getDefinition();
6471 << Context.getTypeDeclType(Specialization) << Range;
6473 Specialization->setInvalidDecl();
6479 ProcessDeclAttributeList(S, Specialization, Attr);
6484 AddAlignmentAttributesForRecord(Specialization);
6485 AddMsStructLayoutForRecord(Specialization);
6489 Diag(Specialization->getLocation(), diag::err_module_private_specialization)
6494 // specialization as the user wrote in the specialization
6496 // from the specialization's declaration the way that the user
6497 // actually wrote the specialization, rather than formatting the
6499 // template arguments in the specialization.
6504 Specialization->setTypeAsWritten(WrittenTy);
6505 Specialization->setTemplateKeywordLoc(TemplateKWLoc);
6509 // A template explicit specialization is in the scope of the
6516 Specialization->setLexicalDeclContext(CurContext);
6518 // We may be starting the definition of this specialization.
6520 Specialization->startDefinition();
6530 // Add the specialization into its lexical context, so that it can
6533 CurContext->addDecl(Specialization);
6535 return Specialization;
6560 // Explicit instantiations following a specialization have no effect and
6573 /// \brief Diagnose cases where we have an explicit template specialization
6576 /// new specialization/instantiation will have any effect.
6578 /// \param NewLoc the location of the new explicit specialization or
6581 /// \param NewTSK the kind of the new explicit specialization or instantiation.
6585 /// \param PrevTSK the kind of the old explicit specialization or instantiatin.
6591 /// specialization or instantiation has no effect and should be ignored.
6638 // is explicitly specialized then that specialization shall be declared
6639 // before the first use of that specialization that would cause an
6643 // Is there any previous explicit specialization declaration?
6673 // specialization for that template, the explicit instantiation has no
6686 // Explicit instantiations following a specialization have no effect and
6707 // an explicit specialization for that template, the explicit
6729 // specialization for that template, the explicit instantiation has no
6732 // Is there any previous explicit specialization declaration?
6759 llvm_unreachable("Missing specialization/instantiation case?");
6763 /// template specialization.
6765 /// The only possible way to get a dependent function template specialization
6803 /// specialization.
6806 /// explicit function template specialization. On successful completion,
6808 /// specialization.
6811 /// function template specialization.
6819 /// this function specialization.
6824 // explicit function template specialization.
6843 // When matching a constexpr member function template specialization
6845 // specialization has an implicit 'const' (because we don't know whether
6867 // template-id naming an explicit function template specialization
6873 FunctionDecl *Specialization = nullptr;
6876 ExplicitTemplateArgs ? &Args : nullptr, FT, Specialization, Info)) {
6888 ConvertedTemplateArgs[Specialization] = std::move(Args);
6889 Candidates.addDecl(Specialization, I.getAccess());
6906 FunctionDecl *Specialization = cast<FunctionDecl>(*Result);
6909 = Specialization->getTemplateSpecializationInfo();
6910 assert(SpecInfo && "Function template specialization info missing?");
6913 // specialization kind was explicit.
6916 Specialization->setLocation(FD->getLocation());
6917 // C++11 [dcl.constexpr]p1: An explicit specialization of a constexpr
6920 Specialization->setConstexpr(FD->isConstexpr());
6923 // FIXME: Check if the prior specialization has a point of instantiation.
6927 // an explicit specialization.
6930 // Check the scope of this explicit specialization.
6933 Specialization->getPrimaryTemplate(),
6934 Specialization, FD->getLocation(),
6940 // explicitly specialized then that specialization shall be declared
6941 // before the first use of that specialization that would cause an implicit
6948 Specialization,
6954 // Mark the prior declaration as an explicit specialization, so that later
6955 // clients know that this is an explicit specialization.
6958 MarkUnusedFileScopedDecl(Specialization);
6962 // specialization, with the template arguments from the previous
6963 // specialization.
6966 TemplateArgumentList(Specialization->getTemplateSpecializationArgs());
6968 Specialization->getPrimaryTemplate(), TemplArgs, /*InsertPos=*/nullptr,
6970 ExplicitTemplateArgs ? &ConvertedTemplateArgs[Specialization] : nullptr);
6972 // The "previous declaration" for this function template specialization is
6973 // the prior function template specialization.
6975 Previous.addDecl(Specialization);
6980 /// specialization.
6983 /// explicit member function specialization. On successful completion,
6985 /// specialization.
6988 /// specialization.
6991 /// by this function specialization; the set will be modified to contain the
7073 // Make sure that this is a specialization of a member.
7083 // explicitly specialized then that specialization shall be declared
7084 // before the first use of that specialization that would cause an implicit
7087 assert(MSInfo && "Member specialization info missing?");
7098 // Check the scope of this explicit specialization.
7106 // the original declaration to note that it is an explicit specialization
7161 // this specialization matches.
7228 // or a static data member of a class template specialization, the name of
7229 // the class template specialization in the qualified-id for the member
7242 // Explicit instantiation of a class template specialization
7259 // Check that the specialization uses the same tag kind as the
7323 // Find the class template specialization declaration that
7341 ClassTemplateSpecializationDecl *Specialization = nullptr;
7356 // Since the only prior class template specialization with these
7361 Specialization = PrevDecl;
7362 Specialization->setLocation(TemplateNameLoc);
7367 if (!Specialization) {
7368 // Create a new class template specialization declaration node for
7369 // this explicit specialization.
7370 Specialization
7378 SetNestedNameSpecifier(Specialization, SS);
7381 // Insert the new specialization.
7382 ClassTemplate->AddSpecialization(Specialization, InsertPos);
7389 // specialization's declaration the way that the user actually wrote
7392 // arguments in the specialization.
7396 Context.getTypeDeclType(Specialization));
7397 Specialization->setTypeAsWritten(WrittenTy);
7400 Specialization->setExternLoc(ExternLoc);
7401 Specialization->setTemplateKeywordLoc(TemplateLoc);
7402 Specialization->setRBraceLoc(SourceLocation());
7405 ProcessDeclAttributeList(S, Specialization, Attr);
7410 Specialization->setLexicalDeclContext(CurContext);
7411 CurContext->addDecl(Specialization);
7415 // Set the template specialization kind.
7416 Specialization->setTemplateSpecializationKind(TSK);
7417 return Specialization;
7429 Specialization->getDefinition());
7431 InstantiateClassTemplateSpecialization(TemplateNameLoc, Specialization, TSK);
7433 MarkVTableUsed(TemplateNameLoc, Specialization, true);
7434 Specialization->setPointOfInstantiation(Def->getPointOfInstantiation());
7437 // Instantiate the members of this class template specialization.
7439 Specialization->getDefinition());
7450 if (!getDLLAttr(Def) && getDLLAttr(Specialization) &&
7456 getDLLAttr(Specialization)->clone(getASTContext()));
7470 // Set the template specialization kind. Make sure it is set before
7472 Specialization->setTemplateSpecializationKind(TSK);
7476 // Set the template specialization kind.
7477 Specialization->setTemplateSpecializationKind(TSK);
7480 return Specialization;
7556 assert(MSInfo && "No member specialization information?");
7687 // A [...] variable [...] template specialization can be explicitly
7707 // FIXME: Check for explicit specialization?
7757 // or a static data member of a class template specialization, the name of
7758 // the class template specialization in the qualified-id for the member
7794 // Check the new variable specialization against the parsed input.
7845 FunctionDecl *Specialization = nullptr;
7850 R, Specialization, Info)) {
7859 Matches.addDecl(Specialization, P.getAccess());
7862 // Find the most specialized function template specialization.
7874 FunctionDecl *Specialization = cast<FunctionDecl>(*Result);
7889 PDiag(DiagID) << Specialization->getType(),
7891 Specialization->getType()->getAs<FunctionProtoType>(),
7892 Specialization->getLocation(), FPT, D.getLocStart());
7899 if (Specialization->getTemplateSpecializationKind() == TSK_Undeclared) {
7902 << Specialization
7903 << (Specialization->getTemplateSpecializationKind() ==
7905 Diag(Specialization->getLocation(), diag::note_explicit_instantiation_here);
7909 FunctionDecl *PrevDecl = Specialization->getPreviousDecl();
7910 if (!PrevDecl && Specialization->isThisDeclarationADefinition())
7911 PrevDecl = Specialization;
7923 // explicit specialization.
7928 Specialization->setTemplateSpecializationKind(TSK, D.getIdentifierLoc());
7931 ProcessDeclAttributeList(S, Specialization, Attr);
7933 if (Specialization->isDefined()) {
7936 Consumer.HandleTopLevelDecl(DeclGroupRef(Specialization));
7938 InstantiateFunctionDefinition(D.getIdentifierLoc(), Specialization);
7942 // or a static data member of a class template specialization, the name of
7943 // the class template specialization in the qualified-id for the member
7947 FunctionTemplateDecl *FunTmpl = Specialization->getPrimaryTemplate();
7953 << Specialization << D.getCXXScopeSpec().getRange();
7957 : Specialization->getInstantiatedFromMemberFunction(),
8056 // Construct a dependent template specialization type.
8083 // Provide source-location information for the template specialization type.
8112 // ... within an explicitly-written template specialization...
8296 /// a class template (or class template partial specialization) that was parsed
8298 /// partial specialization thereof). This routine will rebuild that type now