Lines Matching refs:Function
39 /// A convenience routine for creating a decayed reference to a function.
167 "Function-to-pointer",
230 // array-to-pointer or function-to-pointer implicit conversions, so
868 // signature as some function in Old (C++ 1.3.10) or if the Old
869 // declarations aren't functions (or function templates) at all. When
898 // into a function template's signature.
920 // function templates hide function templates with different
957 // Only function declarations can be overloaded; object and type
986 // A function template can be overloaded with other function templates
991 // Is the function New an overload of the function Old?
999 // If either of these functions is a K&R-style function (no
1008 // The signature of a function includes the types of its
1018 // The signature of a function template consists of its function
1024 // We check the return type and template parameter lists for function
1036 // If the function is a class member, its signature includes the
1037 // cv-qualifiers (if any) and ref-qualifier (if any) on the function itself.
1053 // - Member function declarations with the same name and the same
1054 // parameter-type-list as well as member function template
1066 // function yet (because we haven't yet resolved whether this is a static
1067 // or non-static member function). Add it now, on the assumption that this
1093 /// \brief Checks availability of the function depending on the current
1094 /// function context. Inside an unavailable function, unavailability is ignored.
1097 /// an available function, false otherwise.
1135 // constructor (i.e., a user-defined conversion function) is
1159 // conversion function that is a candidate by 13.3.1.3 when
1174 ICS.Ambiguous.addConversion(Cand->Function);
1184 /// function returns an implicit conversion sequence that can be used
1233 // constructor (i.e., a user-defined conversion function) is
1309 /// conversion that strips "noreturn" off the nested function type.
1439 // array-to-pointer conversion, or function-to-pointer conversion
1447 // We were able to resolve the address of the overloaded function,
1448 // so we can convert to the type of that function.
1456 // if the function type matches except for [[noreturn]], it's ok
1465 // function and recompute the FromType accordingly. Take advantage of the
1481 "Non-address-of operator for overloaded function expression");
1494 // A glvalue (3.10) of a non-function, non-array type T can
1537 // Function-to-pointer conversion (C++ 4.3).
1540 // An lvalue of function type T can be converted to an rvalue of
1542 // function. (C++ 4.3p1).
1628 // Compatible conversions (Clang extension for C function overloading)
2078 // MSVC allows implicit function to void* type conversion.
2279 // If the function types are exactly the same, this isn't an
2286 // function types are obviously different.
2302 // Function types are too different. Abort.
2434 // function types are obviously different.
2503 /// function types. Catches different number of parameter, mismatch in
2513 // Get the function type from the pointers.
2551 // Both types need to be function types.
2591 /// FunctionArgTypesAreEqual - This routine checks two function proto types
2992 // Record the standard conversion we used and the conversion function.
2993 CXXConstructorDecl *Constructor = cast<CXXConstructorDecl>(Best->Function);
3172 // Record the standard conversion we used and the conversion function.
3174 = dyn_cast<CXXConstructorDecl>(Best->Function)) {
3202 = dyn_cast<CXXConversionDecl>(Best->Function)) {
3206 // conversion function (12.3.2), the initial standard
3208 // implicit object parameter of the conversion function.
3227 llvm_unreachable("Not a constructor or conversion function?");
3275 // a lambda closure type to a function pointer and a block pointer,
3276 // respectively, always prefer the conversion to a function pointer,
3277 // because the function pointer is more lightweight and is more likely
3342 // they contain the same user-defined conversion function or
3435 // implicit object parameter of a non-static member function declared
3438 // lvalue reference to a function lvalue and S2 binds an rvalue
4078 // If the conversion function doesn't return a reference type,
4080 // is only acceptable if its referencee is a function type.
4106 // applying a conversion function to the argument
4110 // conversion or, if the conversion function returns an
4120 ICS.UserDefined.ConversionFunction = Best->Function;
4133 ICS.Ambiguous.addConversion(Cand->Function);
4162 // If the initializer is the address of an overloaded function, try
4163 // to resolve the overloaded function. If all goes well, T2 is the
4164 // type of the resulting function.
4263 // -- is an xvalue, class prvalue, array prvalue or function
4299 // an xvalue, class prvalue, or function lvalue of type
4490 // This function can deal with initializer lists.
4541 // If the initializer is the address of an overloaded function, try
4542 // to resolve the overloaded function. If all goes well, T2 is the
4543 // type of the resulting function.
4665 /// parameter of the given member function (@c Method) from the
4703 // where X is the class of which the function is a member and cv is the
4704 // cv-qualification on the member function declaration.
5147 // FIXME: Check for missing '()' if T is a function type?
5221 // explicit conversion function.
5292 /// AddOverloadCandidate - Adds the given function to the set of
5293 /// candidate functions, using the given function call arguments. If
5298 /// based on an incomplete set of function arguments. This feature is used by
5301 Sema::AddOverloadCandidate(FunctionDecl *Function,
5309 = dyn_cast<FunctionProtoType>(Function->getType()->getAs<FunctionType>());
5311 assert(!Function->getDescribedFunctionTemplate() &&
5312 "Use AddTemplateOverloadCandidate for function templates");
5314 if (CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(Function)) {
5316 // If we get here, it's because we're calling a member function
5320 // function, e.g., X::f(). We use an empty type for the implied
5328 // We treat a constructor like a non-member function, since its object
5332 if (!CandidateSet.isNewCandidate(Function))
5338 if (CXXConstructorDecl *Constructor = dyn_cast<CXXConstructorDecl>(Function)){
5340 // A member function template is never instantiated to perform the copy
5353 Candidate.Function = Function;
5361 // (C++ 13.3.2p2): A candidate function having fewer than m
5371 // (C++ 13.3.2p2): A candidate function having more than m parameters
5376 unsigned MinRequiredArgs = Function->getMinRequiredArguments();
5387 if (CheckCUDATarget(Caller, Function)) {
5397 // (C++ 13.3.2p3): for F to be a viable function, there shall
5423 /// \brief Add all of the function declarations in the given function set to
5476 "Expected a member function template");
5490 /// AddMethodCandidate - Adds the given C++ member function to the set
5491 /// of candidate functions, using the given function call arguments
5519 Candidate.Function = Method;
5526 // (C++ 13.3.2p2): A candidate function having fewer than m
5535 // (C++ 13.3.2p2): A candidate function having more than m parameters
5570 // (C++ 13.3.2p3): for F to be a viable function, there shall
5595 /// \brief Add a C++ member function template as a candidate to the candidate
5597 /// function template specialization.
5612 // In each case where a candidate is a function template, candidate
5613 // function template specializations are generated using template argument
5616 // or more function templates and also to a set of overloaded non-template
5618 // function template are combined with the set of non-template candidate
5627 Candidate.Function = MethodTmpl->getTemplatedDecl();
5638 // Add the function template specialization produced by template argument
5640 assert(Specialization && "Missing member function template specialization?");
5642 "Specialization is not a member function?");
5648 /// \brief Add a C++ function template specialization as a candidate
5650 /// an appropriate function template specialization.
5662 // In each case where a candidate is a function template, candidate
5663 // function template specializations are generated using template argument
5666 // or more function templates and also to a set of overloaded non-template
5668 // function template are combined with the set of non-template candidate
5677 Candidate.Function = FunctionTemplate->getTemplatedDecl();
5688 // Add the function template specialization produced by template argument
5690 assert(Specialization && "Missing function template specialization?");
5695 /// AddConversionCandidate - Add a C++ conversion function as a
5700 /// conversion function produces).
5708 "Conversion function templates use AddTemplateConversionCandidate");
5719 Candidate.Function = Conversion;
5729 // For conversion functions, the function is considered to be a member of
5752 // We won't go through a user-define type conversion function to convert a
5765 // conversion function to the type we're eventually trying to
5767 // conversion function and attempt copy initialization from it. This
5806 // conversion function template, the second standard conversion sequence
5837 /// \brief Adds a conversion function template specialization
5839 /// to deduce the template arguments of the conversion function
5849 "Only conversion function templates permitted here");
5861 Candidate.Function = FunctionTemplate->getTemplatedDecl();
5872 // Add the conversion function template specialization produced by
5874 assert(Specialization && "Missing function template specialization?");
5879 /// AddSurrogateCandidate - Adds a "surrogate" candidate function that
5880 /// converts the given @c Object to a function pointer via the
5881 /// conversion function @c Conversion, and then attempts to call it
5883 /// the type of function that we'll eventually be calling.
5899 Candidate.Function = 0;
5935 // (C++ 13.3.2p2): A candidate function having fewer than m
5944 // Function types don't have any default arguments, so just check if
5957 // (C++ 13.3.2p3): for F to be a viable function, there shall
6050 Candidate.Function = 0;
6368 // Skip conversion function templates; they don't tell us anything
6382 /// \brief Helper function for AddBuiltinOperatorCandidates() that adds
6734 // For every function type T that does not have cv-qualifiers or a
6882 if (!C->Viable || !C->Function || C->Function->getNumParams() != 2)
6885 if (C->Function->isFunctionTemplateSpecialization())
6889 C->Function->getParamDecl(0)->getType().getUnqualifiedType();
6891 C->Function->getParamDecl(1)->getType().getUnqualifiedType();
7438 // type or a function type, and CV1 and CV2 are cv-qualifier-seqs,
7732 /// \brief Add function candidates found via argument-dependent lookup
7736 /// given function name (which may also be an operator name) and adds
7762 if (Cand->Function) {
7763 Fns.erase(Cand->Function);
7764 if (FunctionTemplateDecl *FunTmpl = Cand->Function->getPrimaryTemplate())
7802 // -- if F is a static member function, ICS1(F) is defined such
7804 // any function G, and, symmetrically, ICS1(G) is neither
7811 // A viable function F1 is defined to be a better function than another
7812 // viable function F2 if for all arguments i, ICSi(F1) is not a worse
7841 // - F1 is a non-template function and F2 is a function template
7843 if ((!Cand1.Function || !Cand1.Function->getPrimaryTemplate()) &&
7844 Cand2.Function && Cand2.Function->getPrimaryTemplate())
7847 // -- F1 and F2 are function template specializations, and the function
7851 if (Cand1.Function && Cand1.Function->getPrimaryTemplate() &&
7852 Cand2.Function && Cand2.Function->getPrimaryTemplate()) {
7854 = S.getMoreSpecializedTemplate(Cand1.Function->getPrimaryTemplate(),
7855 Cand2.Function->getPrimaryTemplate(),
7857 isa<CXXConversionDecl>(Cand1.Function)? TPOC_Conversion
7860 return BetterTemplate == Cand1.Function->getPrimaryTemplate();
7869 if (UserDefinedConversion && Cand1.Function && Cand2.Function &&
7870 isa<CXXConversionDecl>(Cand1.Function) &&
7871 isa<CXXConversionDecl>(Cand2.Function)) {
7874 // cases such as the conversion from a lambda closure type to a function
7877 = compareConversionFunctions(S, Cand1.Function, Cand2.Function);
7901 /// \brief Computes the best viable function (C++ 13.3.3)
7904 /// \param Loc The location of the function name (or operator symbol) for
7908 /// function, \p Best points to the candidate function found.
7915 // Find the best viable function.
7928 // Make sure that this function is better than every other viable
7929 // function. If not, we have an ambiguity.
7940 // Best is the best viable function.
7941 if (Best->Function &&
7942 (Best->Function->isDeleted() ||
7943 S.isFunctionConsideredUnavailable(Best->Function)))
7996 // This actually gets spelled 'candidate function' for now, but
8088 assert(Cand->Function && "for now, candidate must be a function");
8089 FunctionDecl *Fn = Cand->Function;
8304 FunctionDecl *Fn = Cand->Function;
8358 FunctionDecl *Fn = Cand->Function; // pattern
8519 FunctionDecl *Callee = Cand->Function;
8546 FunctionDecl *Fn = Cand->Function;
8598 // Desugar the type of the surrogate down to a function type,
8600 // the function type (and, therefore, its parameter types).
8618 // Desugar down to a function type.
8664 if (Cand->Function)
8665 return Cand->Function->getLocation();
8855 } else if (Cand->Function) {
8856 Proto = Cand->Function->getType()->getAs<FunctionProtoType>();
8857 if (isa<CXXMethodDecl>(Cand->Function) &&
8858 !isa<CXXConstructorDecl>(Cand->Function))
8912 if (Cand->Function || Cand->IsSurrogate)
8938 if (Cand->Function)
8987 // A helper class to help with address of function resolution
8994 QualType TargetFunctionType; // Extracted function type from target type
9029 // If the target type is a non-function type and the function
9030 // found is a non-static member function, pretend as if that was
9034 // And skip adding the function if its not in the proper form.
9052 // If more than one function is selected, [...]
9081 // Skip non-static function templates when converting to pointer, and
9090 // If the name is a function template, template argument deduction is
9093 // function template specialization, which is added to the set of
9108 // This function template specicalization works.
9159 // Look through any using declarations to find the underlying function.
9164 // targets of type "pointer-to-function" or "reference-to-function."
9166 // type "pointer-to-member-function."
9183 // [...] and any given function template specialization F1 is
9184 // eliminated if the set contains a second function template
9185 // specialization whose function template is more specialized
9186 // than the function template of F1 according to the partial
9191 // best viable function in an overload set) that identifies the
9192 // best function template (if it exists).
9217 // [...] any function template specializations in the set are
9218 // eliminated if the set also contains a non-template function, [...]
9280 /// an overloaded function (C++ [over.over]), where @p From is an
9281 /// expression with overloaded function type and @p ToType is the type
9327 /// \brief Given an expression that refers to an overloaded function, try to
9328 /// resolve that overloaded function expression down to a single function.
9330 /// This routine can only resolve template-ids that refer to a single function
9340 // overloaded function name is ignored (5.1). ]
9342 // [...] The overloaded function name can be preceded by the &
9361 // identifies a single function template specialization, then the
9362 // template-id is an lvalue for the function template specialization.
9367 // If the name is a function template, template argument deduction is
9370 // function template specialization, which is added to the set of
9405 // because it identifies a single function template specialization.
9456 // If desired, do function-to-pointer decay.
9536 // -- a block-scope function declaration that is not a
9539 // -- a declaration that is neither a function or a function
9621 // declaring the function there instead.
9632 // Never suggest declaring a function within namespace 'std'.
9636 // Never suggest declaring a function within a namespace with a reserved
9649 SemaRef.Diag(Best->Function->getLocation(),
9653 SemaRef.Diag(Best->Function->getLocation(),
9660 SemaRef.Diag(Best->Function->getLocation(),
9665 // Try to recover by calling this function.
9715 // If the Decl is neither a function nor a template function,
9716 // determine if it is a pointer or reference to a function. If so,
9839 /// the given function.
9880 // In Microsoft mode, if we are inside a template class member function then
9922 FunctionDecl *FDecl = (*Best)->Function;
9958 << (*Best)->Function->isDeleted()
9960 << SemaRef.getDeletedOrUnavailableSuffix((*Best)->Function)
9965 // We emitted an error for the unvailable/deleted function call but keep
9967 FunctionDecl *FDecl = (*Best)->Function;
9980 /// arguments Args/NumArgs, attempt to resolve the function call down
9981 /// to a specific function. If overload resolution succeeds, returns
10081 function set.
10104 FunctionDecl *FnDecl = Best->Function;
10171 // a non-member function. Check for non-member operators which were
10175 // FIXME: Recover by calling the found function.
10178 // No viable function; fall through to handling this as a
10194 << Best->Function->isDeleted()
10196 << getDeletedOrUnavailableSuffix(Best->Function)
10303 // Add the candidates from the given function set.
10325 FunctionDecl *FnDecl = Best->Function;
10440 // a non-member function. Check for non-member operators which were
10443 // FIXME: Recover by calling the found function.
10446 // No viable function; try to create a built-in operation, which will
10468 if (isImplicitlyDeleted(Best->Function)) {
10469 CXXMethodDecl *Method = cast<CXXMethodDecl>(Best->Function);
10480 << Best->Function->isDeleted()
10482 << getDeletedOrUnavailableSuffix(Best->Function)
10534 // Subscript can only be overloaded as a member function.
10549 FunctionDecl *FnDecl = Best->Function;
10652 << Best->Function->isDeleted() << "[]"
10653 << getDeletedOrUnavailableSuffix(Best->Function)
10665 /// function. MemExpr is the expression that refers to the member
10666 /// function (and includes the object parameter), Args/NumArgs are the
10667 /// arguments to the function call (not including the object
10669 /// expression refers to a non-static member function or an overloaded
10670 /// member function.
10679 // argument and the member function we're referring to.
10682 // Determine whether this is a call to a pointer-to-member function.
10695 // member function we're calling.
10778 // non-template member function.
10804 Method = cast<CXXMethodDecl>(Best->Function);
10829 << Best->Function->isDeleted()
10831 << getDeletedOrUnavailableSuffix(Best->Function)
10842 // non-member call based on that function.
10866 // Convert the object argument (for a non-static member function call).
10909 /// overloaded function call operator (@c operator()) or performing a
10928 // If the primary-expression E in the function call syntax
10930 // candidate functions includes at least the function call
10931 // operators of T. The function call operators of T are obtained by
10953 // In addition, for each (non-explicit in C++0x) conversion function
10960 // denotes the type "pointer to function of (P1,...,Pn) returning
10961 // R", or the type "reference to pointer to function of
10962 // (P1,...,Pn) returning R", or the type "reference to function
10963 // of (P1,...,Pn) returning R", a surrogate call function [...]
10964 // is also considered as a candidate function. Similarly,
10966 // functions for each conversion function declared in an
10967 // accessible base class provided the function is not hidden
10987 // any) to get down to what might be a function type.
11036 << Best->Function->isDeleted()
11038 << getDeletedOrUnavailableSuffix(Best->Function)
11050 if (Best->Function == 0) {
11051 // Since there is no function declaration, this is one of the
11052 // surrogate candidates. Dig out the conversion function.
11061 // object parameter to a function pointer. Perform the conversion
11084 CXXMethodDecl *Method = cast<CXXMethodDecl>(Best->Function);
11222 // the operator is selected as the best match function by the
11270 << Best->Function->isDeleted()
11272 << getDeletedOrUnavailableSuffix(Best->Function)
11281 CXXMethodDecl *Method = cast<CXXMethodDecl>(Best->Function);
11344 FunctionDecl *FD = Best->Function;
11384 /// will be invoked. Otherwise, the function will be found via argument
11457 /// a C++ overloaded function (possibly with some parentheses and
11458 /// perhaps a '&' around it). We have resolved the overloaded function
11459 /// to the function declaration Fn, so patch up the expression E to
11490 "Can only take the address of an overloaded function");
11497 // UnresolvedLookupExpr holding an overloaded member function
11510 // function. Perform the computation here so that we get the
11619 llvm_unreachable("Invalid reference to overloaded function");