diff options
| author | Douglas Gregor <dgregor@apple.com> | 2010-11-08 17:16:59 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2010-11-08 17:16:59 +0000 |
| commit | bd6b17f4efb44b1b002600e67c28454f05ff8665 (patch) | |
| tree | 927788525c6463a06aea9c7b8b46481ae421868d /clang/lib/AST/DeclCXX.cpp | |
| parent | 2cd1fd4a828812e3b45b5144ae8cb7ce950792cd (diff) | |
| download | bcm5719-llvm-bd6b17f4efb44b1b002600e67c28454f05ff8665.tar.gz bcm5719-llvm-bd6b17f4efb44b1b002600e67c28454f05ff8665.zip | |
Improve our handling of C++ [class.copy]p3, which specifies that a
constructor template will not be used to copy a class object to a
value of its own type. We were eliminating all constructor templates
whose specializations look like a copy constructor, which eliminated
important candidates. Fixes PR8182.
llvm-svn: 118418
Diffstat (limited to 'clang/lib/AST/DeclCXX.cpp')
| -rw-r--r-- | clang/lib/AST/DeclCXX.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/clang/lib/AST/DeclCXX.cpp b/clang/lib/AST/DeclCXX.cpp index 17f2dfda648..bcb47baa24f 100644 --- a/clang/lib/AST/DeclCXX.cpp +++ b/clang/lib/AST/DeclCXX.cpp @@ -1176,7 +1176,7 @@ bool CXXConstructorDecl::isConvertingConstructor(bool AllowExplicit) const { (getNumParams() > 1 && getParamDecl(1)->hasDefaultArg()); } -bool CXXConstructorDecl::isCopyConstructorLikeSpecialization() const { +bool CXXConstructorDecl::isSpecializationCopyingObject() const { if ((getNumParams() < 1) || (getNumParams() > 1 && !getParamDecl(1)->hasDefaultArg()) || (getPrimaryTemplate() == 0) || @@ -1188,12 +1188,6 @@ bool CXXConstructorDecl::isCopyConstructorLikeSpecialization() const { ASTContext &Context = getASTContext(); CanQualType ParamType = Context.getCanonicalType(Param->getType()); - // Strip off the lvalue reference, if any. - if (CanQual<LValueReferenceType> ParamRefType - = ParamType->getAs<LValueReferenceType>()) - ParamType = ParamRefType->getPointeeType(); - - // Is it the same as our our class type? CanQualType ClassTy = Context.getCanonicalType(Context.getTagDeclType(getParent())); |

