summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclCXX.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-11-13 23:59:09 +0000
committerDouglas Gregor <dgregor@apple.com>2009-11-13 23:59:09 +0000
commitff7028a55e8c8524dee4a86e3deda3d4a8ff2d88 (patch)
tree60a44285fae6f94df5450d0cf6b1a7e120bdcf92 /clang/lib/AST/DeclCXX.cpp
parentc5a332cefb53d9528e33c95694cc6bff9600ff3f (diff)
downloadbcm5719-llvm-ff7028a55e8c8524dee4a86e3deda3d4a8ff2d88.tar.gz
bcm5719-llvm-ff7028a55e8c8524dee4a86e3deda3d4a8ff2d88.zip
Revert r88718, which does NOT solve the constructor-template-as-copy-constructor issue. Big thanks to John for finding this
llvm-svn: 88724
Diffstat (limited to 'clang/lib/AST/DeclCXX.cpp')
-rw-r--r--clang/lib/AST/DeclCXX.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/clang/lib/AST/DeclCXX.cpp b/clang/lib/AST/DeclCXX.cpp
index 69a577f1e70..e325a25c762 100644
--- a/clang/lib/AST/DeclCXX.cpp
+++ b/clang/lib/AST/DeclCXX.cpp
@@ -707,23 +707,23 @@ CXXConstructorDecl::isCopyConstructor(ASTContext &Context,
// if its first parameter is of type X&, const X&, volatile X& or
// const volatile X&, and either there are no other parameters
// or else all other parameters have default arguments (8.3.6).
- //
- // Note that we also test cv 'X' as a copy constructor, even though it is
- // ill-formed, because this helps enforce C++ [class.copy]p3.
if ((getNumParams() < 1) ||
(getNumParams() > 1 && !getParamDecl(1)->hasDefaultArg()) ||
+ (getPrimaryTemplate() != 0) ||
(getDescribedFunctionTemplate() != 0))
return false;
const ParmVarDecl *Param = getParamDecl(0);
// Do we have a reference type? Rvalue references don't count.
- CanQualType PointeeType = Context.getCanonicalType(Param->getType());
- if (CanQual<LValueReferenceType> ParamRefType =
- PointeeType->getAs<LValueReferenceType>())
- PointeeType = ParamRefType->getPointeeType();
+ const LValueReferenceType *ParamRefType =
+ Param->getType()->getAs<LValueReferenceType>();
+ if (!ParamRefType)
+ return false;
- // Do we have our class type?
+ // Is it a reference to our class type?
+ CanQualType PointeeType
+ = Context.getCanonicalType(ParamRefType->getPointeeType());
CanQualType ClassTy
= Context.getCanonicalType(Context.getTagDeclType(getParent()));
if (PointeeType.getUnqualifiedType() != ClassTy)
OpenPOWER on IntegriCloud