A non-explicit constructor template with a second parameter that is a

parameter pack is a converting constructor. Fixes PR13003.

llvm-svn: 158040
This commit is contained in:
Douglas Gregor 2012-06-05 23:44:51 +00:00
parent c4392d2ad0
commit c65e1598ad
2 changed files with 24 additions and 1 deletions

View File

@ -1695,7 +1695,9 @@ bool CXXConstructorDecl::isConvertingConstructor(bool AllowExplicit) const {
return (getNumParams() == 0 &&
getType()->getAs<FunctionProtoType>()->isVariadic()) ||
(getNumParams() == 1) ||
(getNumParams() > 1 && getParamDecl(1)->hasDefaultArg());
(getNumParams() > 1 &&
(getParamDecl(1)->hasDefaultArg() ||
getParamDecl(1)->isParameterPack()));
}
bool CXXConstructorDecl::isSpecializationCopyingObject() const {

View File

@ -0,0 +1,21 @@
// RUN: %clang_cc1 -std=c++11 %s -verify
namespace PR13003 {
struct void_type
{
template <typename Arg0, typename... Args>
void_type(Arg0&&, Args&&...) { }
};
struct void_type2
{
template <typename... Args>
void_type2(Args&&...) { }
};
struct atom { };
void_type v1 = atom();
void_type2 v2 = atom();
}