diff options
-rw-r--r-- | lib/AST/DeclCXX.cpp | 4 | ||||
-rw-r--r-- | test/CXX/special/class.conv/class.conv.ctor/p1.cpp | 21 |
2 files changed, 24 insertions, 1 deletions
diff --git a/lib/AST/DeclCXX.cpp b/lib/AST/DeclCXX.cpp index 0c78abb813..571ad4b39c 100644 --- a/lib/AST/DeclCXX.cpp +++ b/lib/AST/DeclCXX.cpp @@ -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 { diff --git a/test/CXX/special/class.conv/class.conv.ctor/p1.cpp b/test/CXX/special/class.conv/class.conv.ctor/p1.cpp new file mode 100644 index 0000000000..d2add82f42 --- /dev/null +++ b/test/CXX/special/class.conv/class.conv.ctor/p1.cpp @@ -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(); +} + |