Lines Matching full:template

10 /// Defines the C++ template declaration subclasses.
62 /// Stores a template parameter of any kind.
69 /// Stores a list of template parameters for a TemplateDecl and its
74 /// The location of the 'template' keyword.
80 /// The number of template parameters in this template
84 /// Whether this template parameter list contains an unexpanded parameter
89 /// Whether this template parameter list has a requires clause.
93 /// Whether any of the template parameters has constrained-parameter
112 template <size_t N, bool HasRequiresClause>
125 /// Iterates through the template parameters in this list.
128 /// Iterates through the template parameters in this list.
145 assert(Idx < size() && "Template parameter index out-of-range"); in getParam()
149 assert(Idx < size() && "Template parameter index out-of-range"); in getParam()
154 /// template specialization.
156 /// This may be fewer than the number of template parameters, if some of
160 /// Get the depth of this template parameter list in the set of
161 /// template parameter lists.
163 /// The first template parameter list in a declaration will have depth 0,
164 /// the second template parameter list will have depth 1, etc.
167 /// Determine whether this template parameter list contains an
171 /// Determine whether this template parameter list contains a parameter pack.
189 /// \brief All associated constraints derived from this template parameter
217 /// Stores a list of template parameters and the associated
220 template <size_t N, bool HasRequiresClause>
242 /// A template argument list.
245 /// The number of template arguments in this template
259 /// Create a new template argument list that copies the given set of
260 /// template arguments.
264 /// Retrieve the template argument at a given index.
266 assert(Idx < NumArguments && "Invalid template argument index"); in get()
270 /// Retrieve the template argument at a given index.
278 /// Retrieve the number of template arguments in this
279 /// template argument list.
282 /// Retrieve a pointer to the template argument list.
295 /// arguments for a template to be equivalent, there may be more than one, and
298 template<typename ParmDecl, typename ArgType>
314 if (auto *Prev = Storage.ValueOrInherited.template dyn_cast<ParmDecl *>()) in getParmOwningDefaultArg()
317 .ValueOrInherited.template is<ParmDecl *>() && in getParmOwningDefaultArg()
330 bool isInherited() const { return ValueOrInherited.template is<ParmDecl*>(); } in isInherited()
336 if (const auto *Prev = ValueOrInherited.template dyn_cast<ParmDecl *>()) in get()
338 if (const auto *C = Storage->ValueOrInherited.template dyn_cast<Chain *>()) in get()
340 return Storage->ValueOrInherited.template get<ArgType>(); in get()
346 if (const auto *D = ValueOrInherited.template dyn_cast<ParmDecl *>()) in getInheritedFrom()
348 if (const auto *C = ValueOrInherited.template dyn_cast<Chain *>()) in getInheritedFrom()
365 ValueOrInherited.template dyn_cast<ParmDecl *>()) { in setInherited()
370 ValueOrInherited.template dyn_cast<Chain *>()) { in setInherited()
376 Chain{InheritedFrom, ValueOrInherited.template get<ArgType>()}; in setInherited()
389 /// \brief The base class of all kinds of template declarations (e.g.,
392 /// The TemplateDecl class stores the list of template parameters and a
398 // Construct a template decl with name, parameters, and templated element.
402 // Construct a template decl with the given name and parameters.
412 /// Get the list of template parameters
417 /// \brief Get the total constraint-expression associated with this template,
420 /// template parameters.
461 /// Provides information about a function template specialization,
463 /// instantiated from a function template.
468 /// The function template specialization that this structure describes and a
472 /// The function template from which this function template
476 llvm::PointerIntPair<FunctionTemplateDecl *, 2> Template; variable
479 /// The template arguments used to produce the function template
480 /// specialization from the function template.
483 /// The template arguments as written in the sources, if provided.
487 /// The point at which this function template specialization was
493 FunctionDecl *FD, FunctionTemplateDecl *Template, in FunctionTemplateSpecializationInfo() argument
497 : Function(FD, MSInfo ? true : false), Template(Template, TSK - 1), in FunctionTemplateSpecializationInfo()
513 Create(ASTContext &C, FunctionDecl *FD, FunctionTemplateDecl *Template,
518 /// Retrieve the declaration of the function template specialization.
521 /// Retrieve the template from which this function was specialized.
522 FunctionTemplateDecl *getTemplate() const { return Template.getPointer(); } in getTemplate()
524 /// Determine what kind of template specialization this is.
526 return (TemplateSpecializationKind)(Template.getInt() + 1); in getTemplateSpecializationKind()
541 /// Set the template specialization kind.
544 "Cannot encode TSK_Undeclared for a function template specialization"); in setTemplateSpecializationKind()
545 Template.setInt(TSK - 1); in setTemplateSpecializationKind()
549 /// template specialization.
557 /// Set the (first) point of instantiation of this function template
563 /// Get the specialization info if this function template specialization is
567 /// template<typename> struct A {
568 /// template<typename> void f();
569 /// template<> void f<int>();
573 /// Here, A<int>::f<int> is a function template specialization that is
579 /// template<> template<> void A<int>::f<int>() {}
582 /// ... declares a function template specialization that is an explicit
591 /// function and the function template, and should always be
613 /// template, which may be a member function, static data member,
629 "Cannot encode undeclared template specializations for members");
636 /// Determine what kind of template specialization this is.
645 /// Set the template specialization kind.
648 "Cannot encode undeclared template specializations for members"); in setTemplateSpecializationKind()
665 /// Provides information about a dependent function-template
672 /// template<typename> struct A {
673 /// template<typename> void f();
674 /// template<> void f<int>(); // DependentFunctionTemplateSpecializationInfo
678 /// As well as dependent friend declarations naming function template
682 /// template \<class T> void foo(T);
683 /// template \<class T> class A {
692 /// The number of candidates for the primary template.
700 /// The template arguments as written in the sources, if provided.
707 /// Returns the candidates for the primary function template.
713 /// Declaration of a redeclarable template.
733 template <typename EntryType> struct SpecEntryTraits {
745 template <typename EntryType, typename SETraits = SpecEntryTraits<EntryType>,
766 template <typename EntryType>
774 template <class EntryType, typename ...ProfileArguments>
779 template <class Derived, class EntryType>
786 /// The template from which this was most
789 /// The boolean value indicates whether this template
801 /// The set of "injected" template arguments used within this
802 /// template.
804 /// This pointer refers to the template arguments (there are as
805 /// many template arguments as template parameters) for the
806 /// template, and is allocated lazily, since most templates do not
812 /// template.
816 /// the same template. Calling this routine may implicitly allocate memory
822 // Construct a template decl with name, parameters, and templated element.
832 template <class decl_type> friend class RedeclarableTemplate;
834 /// Retrieves the canonical declaration of this template.
842 /// Determines whether this template was a specialization of a
843 /// member template.
845 /// In the following example, the function template \c X<int>::f and the
846 /// member template \c X<int>::Inner are member specializations.
849 /// template<typename T>
851 /// template<typename U> void f(T, U);
852 /// template<typename U> struct Inner;
855 /// template<> template<typename T>
857 /// template<> template<typename T>
864 /// Note that this member template is a specialization.
867 "Only member templates can be member template specializations"); in setMemberSpecialization()
871 /// Retrieve the member template from which this template was
872 /// instantiated, or nullptr if this template was not instantiated from a
873 /// member template.
875 /// A template is instantiated from a member template when the member
876 /// template itself is part of a class template (or member thereof). For
880 /// template<typename T>
882 /// template<typename U> void f(T, U);
891 /// template
894 /// template<typename U> void X<int>::f(int, U);
899 /// retrieve the FunctionTemplateDecl for the original template \c f within
900 /// the class template \c X<T>, i.e.,
903 /// template<typename T>
904 /// template<typename U>
916 /// Retrieve the "injected" template arguments that correspond to the
917 /// template parameters of this template.
919 /// Although the C++ standard has no notion of the "injected" template
920 /// arguments for a template, the notion is convenient when
921 /// we need to perform substitutions inside the definition of a template.
942 template <> struct RedeclarableTemplateDecl::
956 /// Declaration of a template function.
962 /// function template.
964 /// The function template specializations for this function
965 /// template, including explicit specializations and instantiations.
983 /// Retrieve the set of function template specializations of this
984 /// function template.
988 /// Add a specialization of this function template.
1002 /// Get the underlying function declaration of the template.
1007 /// Returns whether this template declaration defines the primary
1027 /// Retrieve the previous declaration of this function template, or
1067 /// Return whether this function template is an abbreviated function template,
1068 /// e.g. `void foo(auto x)` or `template<typename T> void foo(auto x)`
1070 // Since the invented template parameters generated from 'auto' parameters
1071 // are either appended to the end of the explicit template parameter list or
1072 // form a new template parameter list, we can simply observe the last
1081 /// Create a function template node.
1088 /// Create an empty function template node.
1098 // Kinds of Template Parameters
1101 /// Defines the position of a template parameter within a template
1104 /// Because template parameter can be listed
1105 /// sequentially for out-of-line template members, each template parameter is
1106 /// given a Depth - the nesting of template parameter scopes - and a Position -
1108 /// This class is inheritedly privately by different kinds of template
1123 "The depth of template parmeter position is more than 2^20!");
1125 "The position of template parmeter position is more than 2^12!");
1131 /// Get the nesting depth of the template parameter.
1135 "The depth of template parmeter position is more than 2^20!");
1139 /// Get the position of the template parameter within its parameter list.
1143 "The position of template parmeter position is more than 2^12!");
1147 /// Get the index of the template parameter within its parameter list.
1151 /// Declaration of a template type parameter.
1155 /// template<typename T> class vector;
1164 /// Whether this template type parameter was declaration with
1170 /// Whether this template type parameter has a type-constraint construct.
1178 /// Whether this type template parameter is an "expanded"
1186 /// The default template argument, if any.
1212 /// Whether this template type parameter was declared with
1223 /// Determine whether this template parameter has a default
1237 /// from a previous declaration of this template.
1242 /// Set the default argument for this template parameter.
1253 /// Removes the default argument of this template parameter.
1258 /// Set whether this template type parameter was declared with
1262 /// Retrieve the depth of the template parameter.
1265 /// Retrieve the index of the template parameter.
1273 /// A template type template parameter pack can be a pack expansion if its
1286 /// Whether this parameter is a template type parameter pack that has a known
1294 /// template<typename ...Types>
1296 /// template<convertible_to<Types> ...Convertibles>
1302 /// its type-constraint. When \c Types is supplied with template arguments by
1315 /// Returns the type constraint associated with this template parameter (if
1325 /// Determine whether this template parameter has a type-constraint.
1330 /// \brief Get the associated-constraints of this template parameter.
1347 /// NonTypeTemplateParmDecl - Declares a non-type template parameter,
1350 /// template<int Size> class array { };
1361 /// The default template argument, if any, and whether or not
1370 /// Whether this non-type template parameter is a parameter pack.
1373 /// Whether this non-type template parameter is an "expanded"
1429 /// Determine whether this template parameter has a default
1443 /// from a previous declaration of this template.
1448 /// Set the default argument for this template parameter, and
1458 /// Removes the default argument of this template parameter.
1461 /// Whether this parameter is a non-type template parameter pack.
1468 /// template<typename T, unsigned ...Dims> struct multi_array;
1474 /// A non-type template parameter pack is a pack expansion if its type
1481 /// Whether this parameter is a non-type template parameter pack
1489 /// template<typename ...Types>
1491 /// template<Types ...Values>
1497 /// which expands \c Types. When \c Types is supplied with template arguments
1533 /// template parameter (if any).
1543 /// Determine whether this non-type template parameter's type has a
1550 /// \brief Get the associated-constraints of this template parameter.
1566 /// TemplateTemplateParmDecl - Declares a template template parameter,
1569 /// template <template <typename> class T> class container { };
1571 /// A template template parameter is a TemplateDecl because it defines the
1572 /// name of a template and the template parameters allowable for substitution.
1578 /// The default template argument, if any.
1583 /// Whether this template template parameter was declaration with
1594 /// Whether this template template parameter is an "expanded"
1596 /// already know the set of template parameters that expansion expands to.
1644 /// Whether this template template parameter was declared with
1648 /// Set whether this template template parameter was declared with
1652 /// Whether this template template parameter is a template
1656 /// template<template <class T> ...MetaFunctions> struct Apply;
1662 /// A template template parameter pack is a pack expansion if its template
1669 /// Whether this parameter is a template template parameter pack that
1670 /// has a known list of different template parameter lists at different
1674 /// pack's template parameter list was itself a pack expansion, and that
1678 /// template<typename...Types> struct Outer {
1679 /// template<template<Types> class...Templates> struct Inner;
1684 /// pack \c Types. When \c Types is supplied with template arguments by
1689 /// Retrieves the number of expansion template parameters in
1705 /// Determine whether this template parameter has a default
1719 /// from a previous declaration of this template.
1724 /// Set the default argument for this template parameter, and
1734 /// Removes the default argument of this template parameter.
1749 /// Represents the builtin template declaration which is used to
1751 /// no real purpose beyond existing as a place to hold template parameters.
1779 /// template.
1781 /// The template arguments as written..
1787 /// The location of the template keyword.
1797 /// Represents a class template specialization, which refers to
1798 /// a class template with a given set of template arguments.
1800 /// Class template specializations represent both explicit
1805 /// template<typename T> class array;
1807 /// template<>
1808 /// class array<bool> { }; // class template specialization array<bool>
1812 /// Structure that stores information about a class template
1813 /// specialization that was instantiated from a class template partial
1816 /// The class template partial specialization from which this
1817 /// class template specialization was instantiated.
1820 /// The template argument list deduced for the class template
1825 /// The template that this specialization specializes
1829 /// Further info for explicit template specialization/instantiation.
1833 /// The template arguments used to describe this specialization.
1836 /// The point where this template was instantiated (if any)
1879 /// Retrieve the template that this specialization specializes.
1882 /// Retrieve the template arguments of the class template
1903 /// owns the primary template)? For example:
1906 /// template<typename T> struct Outer {
1907 /// template<typename U> struct Inner;
1908 /// template<> struct Inner; // class-scope explicit specialization
1942 /// If this class template specialization is an instantiation of
1943 /// a template (rather than an explicit specialization), return the
1944 /// class template or class template partial specialization from which it
1956 /// Retrieve the class template or class template partial
1968 /// Retrieve the set of template arguments that should be used
1969 /// to instantiate members of the class template or class template partial
1970 /// specialization from which this class template specialization was
1973 /// \returns For a class template specialization instantiated from the primary
1974 /// template, this function will return the same template arguments as
1975 /// getTemplateArgs(). For a class template specialization instantiated from
1976 /// a class template partial specialization, this function will return the
1977 /// deduced template arguments for the class template partial specialization
1987 /// Note that this class template specialization is actually an
1988 /// instantiation of the given class template partial specialization whose
1989 /// template arguments have been deduced.
1993 "Already set to a class template partial specialization!");
2000 /// Note that this class template specialization is an instantiation
2001 /// of the given class template.
2004 "Previously set to a class template partial specialization!");
2008 /// Retrieve the template argument list as written in the sources,
2016 /// Set the template argument list as written in the sources.
2025 /// Set the template argument list as written in the sources.
2041 /// Gets the location of the template keyword, if present.
2048 /// Sets the location of the template keyword.
2075 /// The list of template parameters
2078 /// The class template partial specialization from which this
2079 /// class template partial specialization was instantiated.
2081 /// The boolean value will be true to indicate that this class template
2118 /// Get the list of template parameters
2137 /// Retrieve the member class template partial specialization from
2138 /// which this particular class template partial specialization was
2142 /// template<typename T>
2144 /// template<typename U> struct Inner;
2145 /// template<typename U> struct Inner<U*> { }; // #1
2154 /// template partial specialization \c Outer<T>::Inner<U*>. Given
2173 /// Determines whether this class template partial specialization
2174 /// template was a specialization of a member partial specialization.
2176 /// In the following example, the member template partial specialization
2180 /// template<typename T>
2182 /// template<typename U> struct Inner;
2183 /// template<typename U> struct Inner<U*>;
2186 /// template<> template<typename T>
2195 /// Note that this member template is a specialization.
2199 "Only member templates can be member template specializations");
2230 /// Declaration of a class template.
2234 /// class template.
2236 /// The class template specializations for this class
2237 /// template, including explicit specializations and instantiations.
2240 /// The class template partial specializations for this class
2241 /// template.
2245 /// The injected-class-name type for this class template.
2251 /// Retrieve the set of specializations of this class template.
2256 /// template.
2284 /// Get the underlying class declarations of the template.
2289 /// Returns whether this template declaration defines the primary
2295 /// \brief Create a class template node.
2302 /// Create an empty class template node.
2323 /// Retrieve the previous declaration of this class template, or
2363 /// Find a class template partial specialization with the given
2367 /// template.
2369 /// \returns the class template partial specialization that exactly matches
2373 /// Find a class template partial specialization which was instantiated
2376 /// \param D a member class template partial specialization.
2378 /// \returns the class template partial specialization which was instantiated
2385 /// Retrieve the template specialization type of the
2386 /// injected-class-name for this class template.
2388 /// The injected-class-name for a class template \c X is \c
2389 /// X<template-args>, where \c template-args is formed from the
2390 /// template arguments that correspond to the template parameters of
2394 /// template<typename T, int N>
2421 /// Declaration of a friend template.
2425 /// template \<typename T> class A {
2426 /// friend class MyVector<T>; // not a friend template
2427 /// template \<typename U> friend class B; // not a friend template
2428 /// template \<typename U> friend class Foo<T>::Nested; // friend template
2441 // The number of template parameters; always non-zero.
2504 /// Declaration of an alias template.
2508 /// template \<typename T> using V = std::map<T*, int, MyCompare<T>>;
2530 /// Get the underlying function declaration of the template.
2545 /// Retrieve the previous declaration of this function template, or
2562 /// Create a function template node.
2569 /// Create an empty alias template node.
2578 /// Represents a variable template specialization, which refers to
2579 /// a variable template with a given set of template arguments.
2581 /// Variable template specializations represent both explicit
2586 /// template<typename T> constexpr T pi = T(3.1415926535897932385);
2588 /// template<>
2589 /// constexpr float pi<float>; // variable template specialization pi<float>
2594 /// Structure that stores information about a variable template
2595 /// specialization that was instantiated from a variable template partial
2598 /// The variable template partial specialization from which this
2599 /// variable template specialization was instantiated.
2602 /// The template argument list deduced for the variable template
2607 /// The template that this specialization specializes.
2611 /// Further info for explicit template specialization/instantiation.
2615 /// The template arguments used to describe this specialization.
2618 /// The point where this template was instantiated (if any).
2626 /// variable template specialization. We can't otherwise tell apart
2663 /// Retrieve the template that this specialization specializes.
2666 /// Retrieve the template arguments of the variable template
2709 /// If this variable template specialization is an instantiation of
2710 /// a template (rather than an explicit specialization), return the
2711 /// variable template or variable template partial specialization from which
2722 /// Retrieve the variable template or variable template partial
2733 /// Retrieve the set of template arguments that should be used
2734 /// to instantiate the initializer of the variable template or variable
2735 /// template partial specialization from which this variable template
2738 /// \returns For a variable template specialization instantiated from the
2739 /// primary template, this function will return the same template arguments
2740 /// as getTemplateArgs(). For a variable template specialization instantiated
2741 /// from a variable template partial specialization, this function will the
2742 /// return deduced template arguments for the variable template partial
2752 /// Note that this variable template specialization is actually an
2753 /// instantiation of the given variable template partial specialization whose
2754 /// template arguments have been deduced.
2758 "Already set to a variable template partial specialization!");
2765 /// Note that this variable template specialization is an instantiation
2766 /// of the given variable template.
2769 "Previously set to a variable template partial specialization!");
2773 /// Retrieve the template argument list as written in the sources,
2781 /// Set the template argument list as written in the sources.
2790 /// Set the template argument list as written in the sources.
2806 /// Gets the location of the template keyword, if present.
2813 /// Sets the location of the template keyword.
2840 /// The list of template parameters
2843 /// The variable template partial specialization from which this
2844 /// variable template partial specialization was instantiated.
2846 /// The boolean value will be true to indicate that this variable template
2884 /// Get the list of template parameters
2903 /// \brief Retrieve the member variable template partial specialization from
2904 /// which this particular variable template partial specialization was
2908 /// template<typename T>
2910 /// template<typename U> U Inner;
2911 /// template<typename U> U* Inner<U*> = (U*)(0); // #1
2914 /// template int* Outer<float>::Inner<int*>;
2920 /// variable template partial specialization \c Outer<T>::Inner<U*>. Given
2935 /// Determines whether this variable template partial specialization
2938 /// In the following example, the member template partial specialization
2942 /// template<typename T>
2944 /// template<typename U> U Inner;
2945 /// template<typename U> U* Inner<U*> = (U*)(0);
2948 /// template<> template<typename T>
2957 /// Note that this member template is a specialization.
2961 "Only member templates can be member template specializations");
2983 /// Declaration of a variable template.
2987 /// variable template.
2989 /// The variable template specializations for this variable
2990 /// template, including explicit specializations and instantiations.
2993 /// The variable template partial specializations for this variable
2994 /// template.
3001 /// Retrieve the set of specializations of this variable template.
3006 /// template.
3028 /// Get the underlying variable declarations of the template.
3033 /// Returns whether this template declaration defines the primary
3041 /// Create a variable template node.
3047 /// Create an empty variable template node.
3066 /// Retrieve the previous declaration of this variable template, or
3106 /// Find a variable template partial specialization which was
3110 /// \param D a member variable template partial specialization.
3112 /// \returns the variable template partial specialization which was
3184 // An implementation detail of ConceptSpecialicationExpr that holds the template
3185 // arguments, so we can later use this to reconstitute the template arguments
3218 /// A template parameter object.
3220 /// Template parameter objects represent values of class type used as template
3221 /// arguments. There is one template parameter object for each such distinct
3222 /// value used as a template argument across the program.
3226 /// template<A> struct S;
3234 /// The value of this template parameter object.
3254 /// Print this template parameter object in a human-readable format.
3307 /// Check whether the template parameter is a pack expansion, and if so,
3311 /// template<typename ...Ts> struct A {
3312 /// template<Ts ...NTs, template<Ts> class ...TTs, typename ...Us> struct B;