Home | History | Annotate | Download | only in Sema

Lines Matching refs:Function

38 /// function.
161 "Function-to-pointer",
224 // array-to-pointer or function-to-pointer implicit conversions, so
630 // signature as some function in Old (C++ 1.3.10) or if the Old
631 // declarations aren't functions (or function templates) at all. When
660 // into a function template's signature.
682 // function templates hide function templates with different
719 // Only function declarations can be overloaded; object and type
740 // A function template can be overloaded with other function templates
745 // Is the function New an overload of the function Old?
753 // If either of these functions is a K&R-style function (no
762 // The signature of a function includes the types of its
772 // The signature of a function template consists of its function
778 // We check the return type and template parameter lists for function
790 // If the function is a class member, its signature includes the
791 // cv-qualifiers (if any) and ref-qualifier (if any) on the function itself.
809 // - Member function declarations with the same name and the same
810 // parameter-type-list as well as member function template
826 /// \brief Checks availability of the function depending on the current
827 /// function context. Inside an unavailable function, unavailability is ignored.
830 /// an available function, false otherwise.
837 /// function returns an implicit conversion sequence that can be used
886 // constructor (i.e., a user-defined conversion function) is
930 // constructor (i.e., a user-defined conversion function) is
954 // conversion function that is a candidate by 13.3.1.3 when
969 ICS.Ambiguous.addConversion(Cand->Function);
1021 /// conversion that strips "noreturn" off the nested function type.
1146 // array-to-pointer conversion, or function-to-pointer conversion
1154 // We were able to resolve the address of the overloaded function,
1155 // so we can convert to the type of that function.
1163 // if the function type matches except for [[noreturn]], it's ok
1172 // function and recompute the FromType accordingly. Take advantage of the
1188 "Non-address-of operator for overloaded function expression");
1201 // A glvalue (3.10) of a non-function, non-array type T can
1238 // Function-to-pointer conversion (C++ 4.3).
1241 // An lvalue of function type T can be converted to an rvalue of
1243 // function. (C++ 4.3p1).
1329 // Compatible conversions (Clang extension for C function overloading)
1756 // MSVC allows implicit function to void* type conversion.
1957 // If the function types are exactly the same, this isn't an
1964 // function types are obviously different.
1980 // Function types are too different. Abort.
2112 // function types are obviously different.
2171 /// FunctionArgTypesAreEqual - This routine checks two function proto types
2589 // Record the standard conversion we used and the conversion function.
2591 = dyn_cast<CXXConstructorDecl>(Best->Function)) {
2615 = dyn_cast<CXXConversionDecl>(Best->Function)) {
2621 // conversion function (12.3.2), the initial standard
2623 // implicit object parameter of the conversion function.
2642 llvm_unreachable("Not a constructor or conversion function?");
2720 // they contain the same user-defined conversion function or
2794 // implicit object parameter of a non-static member function declared
2797 // lvalue reference to a function lvalue and S2 binds an rvalue
3436 // If the conversion function doesn't return a reference type,
3438 // is only acceptable if its referencee is a function type.
3464 // applying a conversion function to the argument
3468 // conversion or, if the conversion function returns an
3474 if (Best->Function)
3475 S.MarkDeclarationReferenced(DeclLoc, Best->Function);
3480 ICS.UserDefined.ConversionFunction = Best->Function;
3493 ICS.Ambiguous.addConversion(Cand->Function);
3522 // If the initializer is the address of an overloaded function, try
3523 // to resolve the overloaded function. If all goes well, T2 is the
3524 // type of the resulting function.
3623 // -- is an xvalue, class prvalue, array prvalue or function
3659 // an xvalue, class prvalue, or function lvalue of type
3896 /// parameter of the given member function (@c Method) from the
3935 // where X is the class of which the function is a member and cv is the
3936 // cv-qualification on the member function declaration.
4175 /// explicit conversion function (because no implicit conversion functions
4182 /// conversion function that could convert to integral or enumeration type.
4185 /// usable conversion function.
4188 /// function, which may be an extension in this case.
4210 // FIXME: Check for missing '()' if T is a function type?
4272 // explicit conversion function.
4334 /// AddOverloadCandidate - Adds the given function to the set of
4335 /// candidate functions, using the given function call arguments. If
4340 /// based on an incomplete set of function arguments. This feature is used by
4343 Sema::AddOverloadCandidate(FunctionDecl *Function,
4350 = dyn_cast<FunctionProtoType>(Function->getType()->getAs<FunctionType>());
4352 assert(!Function->getDescribedFunctionTemplate() &&
4353 "Use AddTemplateOverloadCandidate for function templates");
4355 if (CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(Function)) {
4357 // If we get here, it's because we're calling a member function
4361 // function, e.g., X::f(). We use an empty type for the implied
4370 // We treat a constructor like a non-member function, since its object
4374 if (!CandidateSet.isNewCandidate(Function))
4380 if (CXXConstructorDecl *Constructor = dyn_cast<CXXConstructorDecl>(Function)){
4382 // A member function template is never instantiated to perform the copy
4396 Candidate.Function = Function;
4404 // (C++ 13.3.2p2): A candidate function having fewer than m
4414 // (C++ 13.3.2p2): A candidate function having more than m parameters
4419 unsigned MinRequiredArgs = Function->getMinRequiredArguments();
4430 if (CheckCUDATarget(Caller, Function)) {
4441 // (C++ 13.3.2p3): for F to be a viable function, there shall
4466 /// \brief Add all of the function declarations in the given function set to
4521 "Expected a member function template");
4534 /// AddMethodCandidate - Adds the given C++ member function to the set
4535 /// of candidate functions, using the given function call arguments
4564 Candidate.Function = Method;
4571 // (C++ 13.3.2p2): A candidate function having fewer than m
4580 // (C++ 13.3.2p2): A candidate function having more than m parameters
4616 // (C++ 13.3.2p3): for F to be a viable function, there shall
4641 /// \brief Add a C++ member function template as a candidate to the candidate
4643 /// function template specialization.
4658 // In each case where a candidate is a function template, candidate
4659 // function template specializations are generated using template argument
4662 // or more function templates and also to a set of overloaded non-template
4664 // function template are combined with the set of non-template candidate
4674 Candidate.Function = MethodTmpl->getTemplatedDecl();
4685 // Add the function template specialization produced by template argument
4687 assert(Specialization && "Missing member function template specialization?");
4689 "Specialization is not a member function?");
4695 /// \brief Add a C++ function template specialization as a candidate
4697 /// an appropriate function template specialization.
4709 // In each case where a candidate is a function template, candidate
4710 // function template specializations are generated using template argument
4713 // or more function templates and also to a set of overloaded non-template
4715 // function template are combined with the set of non-template candidate
4725 Candidate.Function = FunctionTemplate->getTemplatedDecl();
4736 // Add the function template specialization produced by template argument
4738 assert(Specialization && "Missing function template specialization?");
4743 /// AddConversionCandidate - Add a C++ conversion function as a
4748 /// conversion function produces).
4756 "Conversion function templates use AddTemplateConversionCandidate");
4768 Candidate.Function = Conversion;
4779 // For conversion functions, the function is considered to be a member of
4802 // We won't go through a user-define type conversion function to convert a
4815 // conversion function to the type we're eventually trying to
4817 // conversion function and attempt copy initialization from it. This
4856 // conversion function template, the second standard conversion sequence
4887 /// \brief Adds a conversion function template specialization
4889 /// to deduce the template arguments of the conversion function
4899 "Only conversion function templates permitted here");
4912 Candidate.Function = FunctionTemplate->getTemplatedDecl();
4923 // Add the conversion function template specialization produced by
4925 assert(Specialization && "Missing function template specialization?");
4930 /// AddSurrogateCandidate - Adds a "surrogate" candidate function that
4931 /// converts the given @c Object to a function pointer via the
4932 /// conversion function @c Conversion, and then attempts to call it
4934 /// the type of function that we'll eventually be calling.
4951 Candidate.Function = 0;
4988 // (C++ 13.3.2p2): A candidate function having fewer than m
4997 // Function types don't have any default arguments, so just check if
5010 // (C++ 13.3.2p3): for F to be a viable function, there shall
5104 Candidate.Function = 0;
5413 // Skip conversion function templates; they don't tell us anything
5427 /// \brief Helper function for AddBuiltinOperatorCandidates() that adds
5741 // For every function type T that does not have cv-qualifiers or a
5870 // types as a built-in candidate operator function, the built-in operator
5871 // function is hidden and is not included in the set of candidate
5890 if (!C->Viable || !C->Function || C->Function->getNumParams() != 2)
5894 C->Function->getParamDecl(0)->getType().getUnqualifiedType();
5896 C->Function->getParamDecl(1)->getType().getUnqualifiedType();
6399 // type or a function type, and CV1 and CV2 are cv-qualifier-seqs,
6693 /// \brief Add function candidates found via argument-dependent lookup
6697 /// given function name (which may also be an operator name) and adds
6725 if (Cand->Function) {
6726 Fns.erase(Cand->Function);
6727 if (FunctionTemplateDecl *FunTmpl = Cand->Function->getPrimaryTemplate())
6765 // -- if F is a static member function, ICS1(F) is defined such
6767 // any function G, and, symmetrically, ICS1(G) is neither
6774 // A viable function F1 is defined to be a better function than another
6775 // viable function F2 if for all arguments i, ICSi(F1) is not a worse
6804 // - F1 is a non-template function and F2 is a function template
6806 if ((!Cand1.Function || !Cand1.Function->getPrimaryTemplate()) &&
6807 Cand2.Function && Cand2.Function->getPrimaryTemplate())
6810 // -- F1 and F2 are function template specializations, and the function
6814 if (Cand1.Function && Cand1.Function->getPrimaryTemplate() &&
6815 Cand2.Function && Cand2.Function->getPrimaryTemplate()) {
6817 = S.getMoreSpecializedTemplate(Cand1.Function->getPrimaryTemplate(),
6818 Cand2.Function->getPrimaryTemplate(),
6820 isa<CXXConversionDecl>(Cand1.Function)? TPOC_Conversion
6823 return BetterTemplate == Cand1.Function->getPrimaryTemplate();
6832 if (UserDefinedConversion && Cand1.Function && Cand2.Function &&
6833 isa<CXXConversionDecl>(Cand1.Function) &&
6834 isa<CXXConversionDecl>(Cand2.Function)) {
6855 /// \brief Computes the best viable function (C++ 13.3.3)
6860 /// \param Loc the location of the function name (or operator symbol) for
6864 /// function, Best points to the candidate function found.
6871 // Find the best viable function.
6884 // Make sure that this function is better than every other viable
6885 // function. If not, we have an ambiguity.
6896 // Best is the best viable function.
6897 if (Best->Function &&
6898 (Best->Function->isDeleted() ||
6899 S.isFunctionConsideredUnavailable(Best->Function)))
6952 // This actually gets spelled 'candidate function' for now, but
7030 assert(Cand->Function && "for now, candidate must be a function");
7031 FunctionDecl *Fn = Cand->Function;
7243 FunctionDecl *Fn = Cand->Function;
7292 FunctionDecl *Fn = Cand->Function; // pattern
7413 FunctionDecl *Callee = Cand->Function;
7440 FunctionDecl *Fn = Cand->Function;
7491 // Desugar the type of the surrogate down to a function type,
7493 // the function type (and, therefore, its parameter types).
7511 // Desugar down to a function type.
7557 if (Cand->Function)
7558 return Cand->Function->getLocation();
7746 } else if (Cand->Function) {
7747 Proto = Cand->Function->getType()->getAs<FunctionProtoType>();
7748 if (isa<CXXMethodDecl>(Cand->Function) &&
7749 !isa<CXXConstructorDecl>(Cand->Function))
7803 if (Cand->Function || Cand->IsSurrogate)
7830 if (Cand->Function)
7879 // A helper class to help with address of function resolution
7886 QualType TargetFunctionType; // Extracted function type from target type
7921 // If the target type is a non-function type and the function
7922 // found is a non-static member function, pretend as if that was
7926 // And skip adding the function if its not in the proper form.
7944 // If more than one function is selected, [...]
7973 // Skip non-static function templates when converting to pointer, and
7982 // If the name is a function template, template argument deduction is
7985 // function template specialization, which is added to the set of
8000 // This function template specicalization works.
8051 function.
8056 // targets of type "pointer-to-function" or "reference-to-function."
8058 // type "pointer-to-member-function."
8075 // [...] and any given function template specialization F1 is
8076 // eliminated if the set contains a second function template
8077 // specialization whose function template is more specialized
8078 // than the function template of F1 according to the partial
8083 // best viable function in an overload set) that identifies the
8084 // best function template (if it exists).
8109 // [...] any function template specializations in the set are
8110 // eliminated if the set also contains a non-template function, [...]
8170 /// an overloaded function (C++ [over.over]), where @p From is an
8171 /// expression with overloaded function type and @p ToType is the type
8214 /// \brief Given an expression that refers to an overloaded function, try to
8215 /// resolve that overloaded function expression down to a single function.
8217 /// This routine can only resolve template-ids that refer to a single function
8227 // overloaded function name is ignored (5.1). ]
8229 // [...] The overloaded function name can be preceded by the &
8248 // identifies a single function template specialization, then the
8249 // template-id is an lvalue for the function template specialization.
8254 // If the name is a function template, template argument deduction is
8257 // function template specialization, which is added to the set of
8292 // because it identifies a single function template specialization.
8343 // If desired, do function-to-pointer decay.
8424 // -- a block-scope function declaration that is not a
8427 // -- a declaration that is neither a function or a function
8508 // declaring the function there instead.
8514 // Never suggest declaring a function within namespace 'std'.
8531 SemaRef.Diag(Best->Function->getLocation(),
8535 SemaRef.Diag(Best->Function->getLocation(),
8542 SemaRef.Diag(Best->Function->getLocation(),
8547 // Try to recover by calling this function.
8628 /// arguments Args/NumArgs, attempt to resolve the function call down
8629 /// to a specific function. If overload resolution succeeds, returns
8630 /// the function declaration produced by overload
8673 // In Microsoft mode, if we are inside a template class member function then
8694 FunctionDecl *FDecl = Best->Function;
8728 << Best->Function->isDeleted()
8730 << getDeletedOrUnavailableSuffix(Best->Function)
8814 // Add the candidates from the given function set.
8836 FunctionDecl *FnDecl = Best->Function;
8906 // a non-member function. Check for non-member operators which were
8909 // FIXME: Recover by calling the found function.
8912 // No viable function; fall through to handling this as a
8927 << Best->Function->isDeleted()
8929 << getDeletedOrUnavailableSuffix(Best->Function)
9065 // Add the candidates from the given function set.
9087 FunctionDecl *FnDecl = Best->Function;
9197 // a non-member function. Check for non-member operators which were
9200 // FIXME: Recover by calling the found function.
9203 // No viable function; try to create a built-in operation, which will
9226 << Best->Function->isDeleted()
9228 << getDeletedOrUnavailableSuffix(Best->Function)
9279 // Subscript can only be overloaded as a member function.
9294 FunctionDecl *FnDecl = Best->Function;
9398 << Best->Function->isDeleted() << "[]"
9399 << getDeletedOrUnavailableSuffix(Best->Function)
9411 /// function. MemExpr is the expression that refers to the member
9412 /// function (and includes the object parameter), Args/NumArgs are the
9413 /// arguments to the function call (not including the object
9415 /// expression refers to a non-static member function or an overloaded
9416 /// member function.
9425 // argument and the member function we're referring to.
9428 // Determine whether this is a call to a pointer-to-member function.
9441 // member function we're calling.
9523 // non-template member function.
9548 Method = cast<CXXMethodDecl>(Best->Function);
9572 << Best->Function->isDeleted()
9574 << getDeletedOrUnavailableSuffix(Best->Function)
9584 // non-member call based on that function.
9607 // Convert the object argument (for a non-static member function call).
9648 /// overloaded function call operator (@c operator()) or performing a
9667 // If the primary-expression E in the function call syntax
9669 // candidate functions includes at least the function call
9670 // operators of T. The function call operators of T are obtained by
9693 // In addition, for each (non-explicit in C++0x) conversion function
9700 // denotes the type "pointer to function of (P1,...,Pn) returning
9701 // R", or the type "reference to pointer to function of
9702 // (P1,...,Pn) returning R", or the type "reference to function
9703 // of (P1,...,Pn) returning R", a surrogate call function [...]
9704 // is also considered as a candidate function. Similarly,
9706 // functions for each conversion function declared in an
9707 // accessible base class provided the function is not hidden
9726 // any) to get down to what might be a function type.
9772 << Best->Function->isDeleted()
9774 << getDeletedOrUnavailableSuffix(Best->Function)
9785 if (Best->Function == 0) {
9786 // Since there is no function declaration, this is one of the
9787 // surrogate candidates. Dig out the conversion function.
9796 // object parameter to a function pointer. Perform the conversion
9810 MarkDeclarationReferenced(LParenLoc, Best->Function);
9817 CXXMethodDecl *Method = cast<CXXMethodDecl>(Best->Function);
9943 // the operator is selected as the best match function by the
9992 << Best->Function->isDeleted()
9994 << getDeletedOrUnavailableSuffix(Best->Function)
10000 MarkDeclarationReferenced(OpLoc, Best->Function);
10005 CXXMethodDecl *Method = cast<CXXMethodDecl>(Best->Function);
10034 /// a C++ overloaded function (possibly with some parentheses and
10035 /// perhaps a '&' around it). We have resolved the overloaded function
10036 /// to the function declaration Fn, so patch up the expression E to
10067 "Can only take the address of an overloaded function");
10074 // UnresolvedLookupExpr holding an overloaded member function
10087 // function. Perform the computation here so that we get the
10187 llvm_unreachable("Invalid reference to overloaded function");