aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaOverload.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/SemaOverload.cpp')
-rw-r--r--lib/Sema/SemaOverload.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index 3948b22f7b..70b080e678 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/lib/Sema/SemaOverload.cpp
@@ -2237,7 +2237,9 @@ Sema::AddOverloadCandidate(FunctionDecl *Function,
// argument doesn't participate in overload resolution.
}
- if (!CandidateSet.isNewCandidate(Function))
+ // FIXME: It would be nice if it were safe to keep invalid methods in the
+ // overload set (but it isn't due to broken copy constructors).
+ if (!CandidateSet.isNewCandidate(Function) || Function->isInvalidDecl())
return;
// Add this candidate