Skip to content
Snippets Groups Projects
Commit 11159915 authored by George Burgess IV's avatar George Burgess IV
Browse files

[Sema] Update CheckOverload docs

- Replace documented return values (true/false) with what's actually
  returned
- Doxygenify the comment
- Reflow said comment to 80 cols

Not overly familiar with Doxygen, so nits are welcome. :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299603 91177308-0d34-0410-b5e6-96231b3b80d8
parent 3934d96f
No related branches found
No related tags found
No related merge requests found
...@@ -917,40 +917,39 @@ static bool checkArgPlaceholdersForOverload(Sema &S, ...@@ -917,40 +917,39 @@ static bool checkArgPlaceholdersForOverload(Sema &S,
return false; return false;
} }
   
// IsOverload - Determine whether the given New declaration is an /// Determine whether the given New declaration is an overload of the
// overload of the declarations in Old. This routine returns false if /// declarations in Old. This routine returns Ovl_Match or Ovl_NonFunction if
// New and Old cannot be overloaded, e.g., if New has the same /// New and Old cannot be overloaded, e.g., if New has the same signature as
// signature as some function in Old (C++ 1.3.10) or if the Old /// some function in Old (C++ 1.3.10) or if the Old declarations aren't
// declarations aren't functions (or function templates) at all. When /// functions (or function templates) at all. When it does return Ovl_Match or
// it does return false, MatchedDecl will point to the decl that New /// Ovl_NonFunction, MatchedDecl will point to the decl that New cannot be
// cannot be overloaded with. This decl may be a UsingShadowDecl on /// overloaded with. This decl may be a UsingShadowDecl on top of the underlying
// top of the underlying declaration. /// declaration.
// ///
// Example: Given the following input: /// Example: Given the following input:
// ///
// void f(int, float); // #1 /// void f(int, float); // #1
// void f(int, int); // #2 /// void f(int, int); // #2
// int f(int, int); // #3 /// int f(int, int); // #3
// ///
// When we process #1, there is no previous declaration of "f", /// When we process #1, there is no previous declaration of "f", so IsOverload
// so IsOverload will not be used. /// will not be used.
// ///
// When we process #2, Old contains only the FunctionDecl for #1. By /// When we process #2, Old contains only the FunctionDecl for #1. By comparing
// comparing the parameter types, we see that #1 and #2 are overloaded /// the parameter types, we see that #1 and #2 are overloaded (since they have
// (since they have different signatures), so this routine returns /// different signatures), so this routine returns Ovl_Overload; MatchedDecl is
// false; MatchedDecl is unchanged. /// unchanged.
// ///
// When we process #3, Old is an overload set containing #1 and #2. We /// When we process #3, Old is an overload set containing #1 and #2. We compare
// compare the signatures of #3 to #1 (they're overloaded, so we do /// the signatures of #3 to #1 (they're overloaded, so we do nothing) and then
// nothing) and then #3 to #2. Since the signatures of #3 and #2 are /// #3 to #2. Since the signatures of #3 and #2 are identical (return types of
// identical (return types of functions are not part of the /// functions are not part of the signature), IsOverload returns Ovl_Match and
// signature), IsOverload returns false and MatchedDecl will be set to /// MatchedDecl will be set to point to the FunctionDecl for #2.
// point to the FunctionDecl for #2. ///
// /// 'NewIsUsingShadowDecl' indicates that 'New' is being introduced into a class
// 'NewIsUsingShadowDecl' indicates that 'New' is being introduced /// by a using declaration. The rules for whether to hide shadow declarations
// into a class by a using declaration. The rules for whether to hide /// ignore some properties which otherwise figure into a function template's
// shadow declarations ignore some properties which otherwise figure /// signature.
// into a function template's signature.
Sema::OverloadKind Sema::OverloadKind
Sema::CheckOverload(Scope *S, FunctionDecl *New, const LookupResult &Old, Sema::CheckOverload(Scope *S, FunctionDecl *New, const LookupResult &Old,
NamedDecl *&Match, bool NewIsUsingDecl) { NamedDecl *&Match, bool NewIsUsingDecl) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment