aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-11-15 08:11:13 +0000
committerDouglas Gregor <dgregor@apple.com>2009-11-15 08:11:13 +0000
commit891fdae811e991d15b26fc165724c4cf6b6737a6 (patch)
tree7dcd5b4c7a6d2b759c13bab7e94d850e1d31c814 /lib/Sema
parentc0513be7557c08684fe4460899d6d47e54439084 (diff)
When adding the underlying declaration of a decl to a lookup-results
set, expand overloaded function declarations. Long-term, this should actually be done by the name-lookup code rather than here, but this part of the code (involving using declarations) is getting a makeover now and the test-case is useful. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88846 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema')
-rw-r--r--lib/Sema/Sema.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h
index b412882b85..d736dfbac5 100644
--- a/lib/Sema/Sema.h
+++ b/lib/Sema/Sema.h
@@ -1212,7 +1212,20 @@ public:
/// \brief Add a declaration to these results.
void addDecl(NamedDecl *D) {
- Decls.push_back(D->getUnderlyingDecl());
+ // "Flatten" overloaded function declarations to get the underlying
+ // functions.
+ // FIXME: This may not be necessary with the impending using-declarations
+ // rewrite (11/09).
+ if (OverloadedFunctionDecl *Ovl
+ = dyn_cast<OverloadedFunctionDecl>(D->getUnderlyingDecl())) {
+ for (OverloadedFunctionDecl::function_iterator
+ F = Ovl->function_begin(),
+ FEnd = Ovl->function_end();
+ F != FEnd; ++F) {
+ Decls.push_back(*F);
+ }
+ } else
+ Decls.push_back(D->getUnderlyingDecl());
Kind = Found;
}