aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaOverload.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-11-13 23:14:53 +0000
committerDouglas Gregor <dgregor@apple.com>2009-11-13 23:14:53 +0000
commitcad84b7c12564ff37feb66d6d004bb609bea8788 (patch)
treeafab19a2565e6069b475747c8b4946490d59d94a /lib/Sema/SemaOverload.cpp
parent65d0e28583ac050ec9aa71b469285faad48d137e (diff)
A constructor template cannot be instantiated to a copy
constructor. Make sure that such declarations can never be formed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88718 91177308-0d34-0410-b5e6-96231b3b80d8
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