Home | History | Annotate | Download | only in Sema

Lines Matching refs:Function

38     /// \brief Within template argument deduction from a function call, we are
42 /// \brief Within template argument deduction from a function call, we
45 /// \brief Within template argument deduction from a function call,
50 /// template argument deduction from a function call where conversions
100 /// performing template argument deduction for partial ordering of function
569 /// \brief Helper function to build a TemplateParameter when we don't
671 /// function types (C++ [temp.deduct.type]p10).
738 // If the original function parameter associated with A is a function
739 // parameter pack and the function parameter associated with P is not
740 // a function parameter pack, then template argument deduction fails.
758 // - A function parameter pack that does not occur at the end of the
764 // If the parameter-declaration corresponding to Pi is a function
768 // template parameter packs expanded by the function parameter pack.
979 // If P and A are function types that originated from deduction when
980 // taking the address of a function template (14.8.2.2) or when deducing
981 // template arguments from a function declaration (14.8.2.6) and Pi and
1039 assert(Arg != S.Context.OverloadTy && "Unresolved overloaded function");
2256 /// given function template according to C++ [temp.arg.explicit].
2258 /// \param FunctionTemplate the function template into which the explicit
2267 /// \param ParamTypes will be populated with the instantiated function
2270 /// \param FunctionType if non-NULL, the result type of the function template
2272 /// the instantiated function type.
2287 FunctionDecl *Function = FunctionTemplate->getTemplatedDecl();
2293 // fill in the function type.
2294 for (FunctionDecl::param_iterator P = Function->param_begin(),
2295 PEnd = Function->param_end();
2301 *FunctionType = Function->getType();
2317 // explicitly-specified template arguments against this function template,
2318 // and then substitute them into the function parameter types.
2367 = Function->getType()->getAs<FunctionProtoType>();
2368 assert(Proto && "Function template does not have a prototype?");
2370 // Instantiate the types of each of the function parameters given the
2371 // explicitly-specified template arguments. If the function has a trailing
2375 if (SubstParmTypes(Function->getLocation(),
2376 Function->param_begin(), Function->getNumParams(),
2387 // If a declaration declares a member function or member function
2390 // and the end of the function-definition, member-declarator, or
2394 if (CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(Function)) {
2404 Function->getTypeSpecStartLoc(),
2405 Function->getDeclName());
2410 // Instantiate the types of each of the function parameters given the
2413 SubstParmTypes(Function->getLocation(),
2414 Function->param_begin(), Function->getNumParams(),
2421 Function->getLocation(),
2422 Function->getDeclName(),
2450 /// \brief Check whether the deduced argument type for a call to a function
2509 // Also allow conversions which merely strip [[noreturn]] from function types
2549 /// \brief Finish template argument deduction for a function template,
2551 /// the function template specialization.
2570 // actual function declaration.
2701 // Substitute the deduced template arguments into the function template
2702 // declaration to produce the function template specialization.
2715 // If the template argument list is owned by the function template
2762 /// Gets the type of a function for template-argument-deducton
2802 // When P is a function type, pointer to function type, or pointer
2803 // to member function type:
2829 // function templates, the parameter is treated as a
2834 // Otherwise, see if we can resolve a function type
2848 // Function-to-pointer conversion.
2853 // - If the argument is an overload set (not containing function
2884 /// overloaded function set that could not be resolved.
2949 // - If A is a function type, the pointer type produced by the
2950 // function-to-pointer standard conversion (4.3) is used in place
3036 /// \brief Perform template argument deduction from a function call
3039 /// \param FunctionTemplate the function template for which we are performing
3045 /// \param Args the function call arguments
3048 /// this will be set to the function template specialization produced by
3064 FunctionDecl *Function = FunctionTemplate->getTemplatedDecl();
3067 // Template argument deduction is done by comparing each function template
3071 if (Args.size() < Function->getMinRequiredArguments())
3073 else if (Args.size() > Function->getNumParams()) {
3075 = Function->getType()->getAs<FunctionProtoType>();
3079 CheckArgs = Function->getNumParams();
3105 // Just fill in the parameter types from the function declaration.
3106 for (unsigned I = 0, N = Function->getNumParams(); I != N; ++I)
3107 ParamTypes.push_back(Function->getParamDecl(I)->getType());
3110 // Deduce template arguments from the function parameters.
3122 // Simple case: matching a function parameter to a function argument.
3176 // For a function parameter pack that occurs at the end of the
3179 // function parameter pack. Each comparison deduces template arguments
3181 // the function parameter pack. For a function parameter pack that does
3291 /// \brief Deduce template arguments when taking the address of a function
3295 /// \param FunctionTemplate the function template for which we are performing
3301 /// \param ArgFunctionType the function type that will be used as the
3303 /// function template's function type. This type may be NULL, if there is no
3307 /// this will be set to the function template specialization produced by
3323 FunctionDecl *Function = FunctionTemplate->getTemplatedDecl();
3326 QualType FunctionType = Function->getType();
3351 // Deduce template arguments from the function type.
3365 // If the requested function type does not match the actual type of the
3375 /// function (C++ [temp.deduct.conv]) and, if successful, produce a
3376 /// conversion function template specialization.
3415 // - If P is a function type, the pointer type produced by the
3416 // function-to-pointer standard conversion (4.3) is used in
3438 // type of the template conversion function (call it P) with the
3481 /// \brief Deduce template arguments for a function template when there is
3484 /// \param FunctionTemplate the function template for which we are performing
3491 /// this will be set to the function template specialization produced by
3694 /// \brief If this is a non-static member function,
3700 // the cv-qualifiers of the function template (if any) and A is
3701 // the class of which the function template is a member.
3715 /// \brief Determine whether the function template \p FT1 is at least as
3729 assert(Proto1 && Proto2 && "Function templates must have prototypes");
3745 // - In the context of a function call, the function parameter types are
3753 // [...] If only one of the function templates is a non-static
3754 // member, that function template is considered to have a new
3755 // first parameter inserted in its function parameter list. The
3757 // the cv-qualifiers of the function template (if any) and A is
3758 // the class of which the function template is a member.
3760 // Note that we interpret this to mean "if one of the function
3766 // first argument of the free function, which seems to match
3784 // the partial ordering of function templates.
3800 // of the conversion function templates are used.
3811 // - In other contexts (14.6.6.2) the function template's function type
3879 /// \brief Determine whether this a function template whose parameter-type-list
3880 /// ends with a function parameter pack.
3882 FunctionDecl *Function = FunTmpl->getTemplatedDecl();
3883 unsigned NumParams = Function->getNumParams();
3887 ParmVarDecl *Last = Function->getParamDecl(NumParams - 1);
3893 if (Function->getParamDecl(NumParams - 1)->isParameterPack())
3900 /// \brief Returns the more specialized function template according
3901 /// to the rules of function template partial ordering (C++ [temp.func.order]).
3903 /// \param FT1 the first function template
3905 /// \param FT2 the second function template
3908 /// function templates.
3913 /// \returns the more specialized function template. If neither
4020 /// \brief Retrieve the most specialized of the given function template
4023 /// \param SpecBegin the start iterator of the function template
4026 /// \param SpecEnd the end iterator of the function template
4029 /// \param TPOC the partial ordering context to use to compare the function
4044 /// \param CandidateDiag partial diagnostic used for each function template
4047 /// describing the template arguments for the function template specialization.
4049 /// \returns the most specialized function template specialization, if
4074 // Find the function template that is better than all of the templates it
4079 assert(BestTemplate && "Not a function template specialization?");
4083 assert(Challenger && "Not a function template specialization?");
4092 // Make sure that the "best" function template is more specialized than all
4150 // function templates, the first function template is at least as
4151 // specialized as the second according to the ordering rules for function
4153 // - the first function template has the same template parameters as the
4154 // first partial specialization and has a single function parameter
4157 // - the second function template has the same template parameters as the
4158 // second partial specialization and has a single function parameter
4162 // Rather than synthesize function templates, we merely perform the
4166 // general problem of function template partial ordering, because
4608 /// call to the given function template.
4618 FunctionDecl *Function = FunctionTemplate->getTemplatedDecl();
4619 for (unsigned I = 0, N = Function->getNumParams(); I != N; ++I)
4620 ::MarkUsedTemplateParameters(Ctx, Function->getParamDecl(I)->getType(),