summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaOverload.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaOverload.cpp')
-rw-r--r--clang/lib/Sema/SemaOverload.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 3948b22f7b6..70b080e678d 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/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
OpenPOWER on IntegriCloud