summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclCXX.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2014-12-14 01:46:53 +0000
committerJohn McCall <rjmccall@apple.com>2014-12-14 01:46:53 +0000
commit578a1f8c6d275d2d3ffe327e72e4cbfed5bad7d8 (patch)
tree20958f18531da4727cde35208a636a9969ea59ce /clang/lib/AST/DeclCXX.cpp
parent706f315e65841a964029c950e8569e6403f7793f (diff)
downloadbcm5719-llvm-578a1f8c6d275d2d3ffe327e72e4cbfed5bad7d8.tar.gz
bcm5719-llvm-578a1f8c6d275d2d3ffe327e72e4cbfed5bad7d8.zip
If a non-template constructor instantiated to X(X),
ignore it during overload resolution when initializing X from a value of type cv X. Previously, our rule here only ignored specializations of constructor templates. That's probably because the standard says that constructors are outright ill-formed if their first parameter is literally X and they're callable with one argument. However, Clang only enforces that prohibition against non-implicit instantiations; I'm not sure why, but it seems to be deliberate. Given that, the most sensible thing to do is to just ignore the "illegal" constructor regardless of where it came from. Also, stop ignoring such constructors silently: print a note explaining why they're being ignored. Fixes <rdar://19199836>. llvm-svn: 224205
Diffstat (limited to 'clang/lib/AST/DeclCXX.cpp')
-rw-r--r--clang/lib/AST/DeclCXX.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/clang/lib/AST/DeclCXX.cpp b/clang/lib/AST/DeclCXX.cpp
index 0ee3e3e9040..a6d9d411eef 100644
--- a/clang/lib/AST/DeclCXX.cpp
+++ b/clang/lib/AST/DeclCXX.cpp
@@ -1831,7 +1831,6 @@ bool CXXConstructorDecl::isConvertingConstructor(bool AllowExplicit) const {
bool CXXConstructorDecl::isSpecializationCopyingObject() const {
if ((getNumParams() < 1) ||
(getNumParams() > 1 && !getParamDecl(1)->hasDefaultArg()) ||
- (getPrimaryTemplate() == nullptr) ||
(getDescribedFunctionTemplate() != nullptr))
return false;
OpenPOWER on IntegriCloud