aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaLookup.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-07-02 23:12:18 +0000
committerDouglas Gregor <dgregor@apple.com>2010-07-02 23:12:18 +0000
commite5eee5a52d98021de862b7965c88577598d52ccb (patch)
tree329784e2c198dcd9c0fb67c71617681e34724d28 /lib/Sema/SemaLookup.cpp
parenta376d10acfacf19d6dfa41069f7929739a18dd7a (diff)
Introduce a new routine, LookupConstructors(), and use it for all
constructor-name lookup. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107536 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaLookup.cpp')
-rw-r--r--lib/Sema/SemaLookup.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp
index 3a62c1151a..6d590893bd 100644
--- a/lib/Sema/SemaLookup.cpp
+++ b/lib/Sema/SemaLookup.cpp
@@ -1990,6 +1990,16 @@ void Sema::LookupOverloadedOperatorName(OverloadedOperatorKind Op, Scope *S,
}
}
+/// \brief Look up the constructors for the given class.
+DeclContext::lookup_result Sema::LookupConstructors(CXXRecordDecl *Class) {
+ if (!Class->getDefinition())
+ return DeclContext::lookup_result();
+
+ CanQualType T = Context.getCanonicalType(Context.getTypeDeclType(Class));
+ DeclarationName Name = Context.DeclarationNames.getCXXConstructorName(T);
+ return Class->lookup(Name);
+}
+
/// \brief Look for the destructor of the given class.
///
/// During semantic analysis, this routine should be used in lieu of