Home | History | Annotate | Download | only in Sema

Lines Matching defs: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
57 /// C++ [over.over] allow matching function types that are compatible in
543 /// \brief Helper function to build a TemplateParameter when we don't
734 /// function types (C++ [temp.deduct.type]p10).
796 // If the original function parameter associated with A is a function
797 // parameter pack and the function parameter associated with P is not
798 // a function parameter pack, then template argument deduction fails.
815 // - A function parameter pack that does not occur at the end of the
821 // If the parameter-declaration corresponding to Pi is a function
825 // template parameter packs expanded by the function parameter pack.
889 /// function types (noreturn adjustment, implicit calling conventions). If any
890 /// of parameter and argument is not a function, just perform type comparison.
1029 // If P and A are function types that originated from deduction when
1030 // taking the address of a function template (14.8.2.2) or when deducing
1031 // template arguments from a function declaration (14.8.2.6) and Pi and
1089 assert(Arg != S.Context.OverloadTy && "Unresolved overloaded function");
2449 /// given function template according to C++ [temp.arg.explicit].
2451 /// \param FunctionTemplate the function template into which the explicit
2460 /// \param ParamTypes will be populated with the instantiated function
2463 /// \param FunctionType if non-NULL, the result type of the function template
2465 /// the instantiated function type.
2480 FunctionDecl *Function = FunctionTemplate->getTemplatedDecl();
2486 // fill in the function type.
2487 for (auto P : Function->parameters())
2491 *FunctionType = Function->getType();
2507 // explicitly-specified template arguments against this function template,
2508 // and then substitute them into the function parameter types.
2557 = Function->getType()->getAs<FunctionProtoType>();
2558 assert(Proto && "Function template does not have a prototype?");
2565 // Instantiate the types of each of the function parameters given the
2566 // explicitly-specified template arguments. If the function has a trailing
2570 if (SubstParmTypes(Function->getLocation(), Function->parameters(),
2581 // If a declaration declares a member function or member function
2584 // and the end of the function-definition, member-declarator, or
2588 if (CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(Function)) {
2599 Function->getTypeSpecStartLoc(), Function->getDeclName());
2604 // Instantiate the types of each of the function parameters given the
2607 SubstParmTypes(Function->getLocation(), Function->parameters(),
2617 Function->getLocation(),
2618 Function->getDeclName(),
2646 /// \brief Check whether the deduced argument type for a call to a function
2708 // Also allow conversions which merely strip [[noreturn]] from function types
2748 /// \brief Finish template argument deduction for a function template,
2750 /// the function template specialization.
2770 // actual function declaration.
2899 // Substitute the deduced template arguments into the function template
2900 // declaration to produce the function template specialization.
2913 // If the template argument list is owned by the function template
2964 /// Gets the type of a function for template-argument-deducton
2968 // We may need to deduce the return type of the function now.
3008 // When P is a function type, pointer to function type, or pointer
3009 // to member function type:
3040 // function templates, the parameter is treated as a
3045 // Otherwise, see if we can resolve a function type
3059 // Function-to-pointer conversion.
3064 // - If the argument is an overload set (not containing function
3095 /// overloaded function set that could not be resolved.
3149 // - If A is a function type, the pointer type produced by the
3150 // function-to-pointer standard conversion (4.3) is used in place
3202 /// deemed to be an argument in a function call.
3214 // each element of the initializer list, taking P0 as a function template
3303 /// \brief Perform template argument deduction from a function call
3306 /// \param FunctionTemplate the function template for which we are performing
3312 /// \param Args the function call arguments
3315 /// this will be set to the function template specialization produced by
3330 FunctionDecl *Function = FunctionTemplate->getTemplatedDecl();
3331 unsigned NumParams = Function->getNumParams();
3334 // Template argument deduction is done by comparing each function template
3338 if (Args.size() < Function->getMinRequiredArguments() && !PartialOverloading)
3342 = Function->getType()->getAs<FunctionProtoType>();
3372 // Just fill in the parameter types from the function declaration.
3374 ParamTypes.push_back(Function->getParamDecl(I)->getType());
3377 // Deduce template arguments from the function parameters.
3389 // Simple case: matching a function parameter to a function argument.
3435 // For a function parameter pack that occurs at the end of the
3438 // function parameter pack. Each comparison deduces template arguments
3440 // the function parameter pack. For a function parameter pack that does
3535 /// \brief Deduce template arguments when taking the address of a function
3539 /// \param FunctionTemplate the function template for which we are performing
3545 /// \param ArgFunctionType the function type that will be used as the
3547 /// function template's function type. This type may be NULL, if there is no
3551 /// this will be set to the function template specialization produced by
3568 FunctionDecl *Function = FunctionTemplate->getTemplatedDecl();
3571 QualType FunctionType = Function->getType();
3597 // If the function has a deduced return type, substitute it for a dependent
3601 Function->getReturnType()->getContainedAutoType()) {
3609 // Deduce template arguments from the function type.
3623 // If the function has a deduced return type, deduce it now, so we can check
3624 // that the deduced function type matches the requested type.
3630 // If the requested function type does not match the actual type of the
3631 // specialization with respect to arguments of compatible pointer to function
3646 /// \brief Given a function declaration (e.g. a generic lambda conversion
3647 /// function) that contains an 'auto' in its result type, substitute it
3650 /// to set the function to.
3666 /// return type of the destination function ptr.
3688 // Use the deduced arguments of the conversion function, to specialize our
3703 // Check to see if the return type of the destination ptr-to-function
3712 // ptr-to-function.
3731 // function.
3758 /// function (C++ [temp.deduct.conv]) and, if successful, produce a
3759 /// conversion function template specialization.
3799 // - If P is a function type, the pointer type produced by the
3800 // function-to-pointer standard conversion (4.3) is used in
3822 // type of the template conversion function (call it P) with the
3865 // to a ptr-to-function, use the deduced arguments from the conversion
3866 // function to specialize the corresponding call operator.
3870 // Get the return type of the destination ptr-to-function we are converting
3872 // type to that of the destination ptr-to-function's return type.
3874 "Can only convert from lambda to ptr-to-function");
3895 /// \brief Deduce template arguments for a function template when there is
3898 /// \param FunctionTemplate the function template for which we are performing
3905 /// this will be set to the function template specialization produced by
4155 /// \brief If this is a non-static member function,
4162 // the cv-qualifiers of the function template (if any) and A is
4163 // the class of which the function template is a member.
4177 /// \brief Determine whether the function template \p FT1 is at least as
4190 assert(Proto1 && Proto2 && "Function templates must have prototypes");
4202 // - In the context of a function call, the function parameter types are
4208 // [...] If only one of the function templates is a non-static
4209 // member, that function template is considered to have a new
4210 // first parameter inserted in its function parameter list. The
4212 // the cv-qualifiers of the function template (if any) and A is
4213 // the class of which the function template is a member.
4215 // Note that we interpret this to mean "if one of the function
4242 // the partial ordering of function templates.
4257 // of the conversion function templates are used.
4266 // - In other contexts (14.6.6.2) the function template's function type
4324 /// \brief Determine whether this a function template whose parameter-type-list
4325 /// ends with a function parameter pack.
4327 FunctionDecl *Function = FunTmpl->getTemplatedDecl();
4328 unsigned NumParams = Function->getNumParams();
4332 ParmVarDecl *Last = Function->getParamDecl(NumParams - 1);
4338 if (Function->getParamDecl(NumParams - 1)->isParameterPack())
4345 /// \brief Returns the more specialized function template according
4346 /// to the rules of function template partial ordering (C++ [temp.func.order]).
4348 /// \param FT1 the first function template
4350 /// \param FT2 the second function template
4353 /// function templates.
4361 /// \returns the more specialized function template. If neither
4403 /// \brief Retrieve the most specialized of the given function template
4406 /// \param SpecBegin the start iterator of the function template
4409 /// \param SpecEnd the end iterator of the function template
4421 /// \param CandidateDiag partial diagnostic used for each function template
4424 /// describing the template arguments for the function template specialization.
4426 /// \returns the most specialized function template specialization, if
4445 // Find the function template that is better than all of the templates it
4450 assert(BestTemplate && "Not a function template specialization?");
4454 assert(Challenger && "Not a function template specialization?");
4463 // Make sure that the "best" function template is more specialized than all
4521 // function templates, the first function template is at least as
4522 // specialized as the second according to the ordering rules for function
4524 // - the first function template has the same template parameters as the
4525 // first partial specialization and has a single function parameter
4528 // - the second function template has the same template parameters as the
4529 // second partial specialization and has a single function parameter
4533 // Rather than synthesize function templates, we merely perform the
4537 // general problem of function template partial ordering, because
5033 /// call to the given function template.
5042 FunctionDecl *Function = FunctionTemplate->getTemplatedDecl();
5043 for (unsigned I = 0, N = Function->getNumParams(); I != N; ++I)
5044 ::MarkUsedTemplateParameters(Ctx, Function->getParamDecl(I)->getType(),