summaryrefslogtreecommitdiffstats
path: root/lib/Sema/SemaLookup.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2015-02-14 12:18:48 +0000
committerdim <dim@FreeBSD.org>2015-02-14 12:18:48 +0000
commitff28d95d1f024411955913aaa68c17f2b09c46fd (patch)
treedfd4e4f0fa9ce6e010e098662d5f00a37c9ff0e3 /lib/Sema/SemaLookup.cpp
parentcf8e1ca250cdf4ade1e7d628e56040eb27797b5d (diff)
downloadFreeBSD-src-ff28d95d1f024411955913aaa68c17f2b09c46fd.zip
FreeBSD-src-ff28d95d1f024411955913aaa68c17f2b09c46fd.tar.gz
Vendor import of clang RELEASE_360/rc3 tag r229040 (effectively, 3.6.0 RC3):
https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_360/rc3@229040
Diffstat (limited to 'lib/Sema/SemaLookup.cpp')
-rw-r--r--lib/Sema/SemaLookup.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp
index a6cd653..ad06872 100644
--- a/lib/Sema/SemaLookup.cpp
+++ b/lib/Sema/SemaLookup.cpp
@@ -2500,8 +2500,18 @@ Sema::SpecialMemberOverloadResult *Sema::LookupSpecialMember(CXXRecordDecl *RD,
// will always be a (possibly implicit) declaration to shadow any others.
OverloadCandidateSet OCS(RD->getLocation(), OverloadCandidateSet::CSK_Normal);
DeclContext::lookup_result R = RD->lookup(Name);
- assert(!R.empty() &&
- "lookup for a constructor or assignment operator was empty");
+
+ if (R.empty()) {
+ // We might have no default constructor because we have a lambda's closure
+ // type, rather than because there's some other declared constructor.
+ // Every class has a copy/move constructor, copy/move assignment, and
+ // destructor.
+ assert(SM == CXXDefaultConstructor &&
+ "lookup for a constructor or assignment operator was empty");
+ Result->setMethod(nullptr);
+ Result->setKind(SpecialMemberOverloadResult::NoMemberOrDeleted);
+ return Result;
+ }
// Copy the candidates as our processing of them may load new declarations
// from an external source and invalidate lookup_result.
OpenPOWER on IntegriCloud