aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-04-17 19:00:52 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-04-17 19:00:52 +0000
commit987c03085558277a5fe8cef8e1b628cabcc626dc (patch)
tree2be148645ad961beef8acc0e1bddf29d4228cd3b /lib/Sema
parent82b0f86252c050b43f2e5d5425d6e37970aabd7c (diff)
PR15755: don't drop parameter packs when dropping parameters with default
arguments in the formation of a candidate set of inheriting constructors. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179708 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema')
-rw-r--r--lib/Sema/SemaDeclCXX.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index fd3489fd53..94a507449b 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -7827,13 +7827,16 @@ private:
// constructor templates that results from omitting any ellipsis parameter
// specification and successively omitting parameters with a default
// argument from the end of the parameter-type-list
- for (unsigned Params = std::max(minParamsToInherit(Ctor),
- Ctor->getMinRequiredArguments()),
- MaxParams = Ctor->getNumParams();
- Params <= MaxParams; ++Params)
- declareCtor(UsingLoc, Ctor,
- SemaRef.Context.getFunctionType(
- Ctor->getResultType(), ArgTypes.slice(0, Params), EPI));
+ unsigned MinParams = minParamsToInherit(Ctor);
+ unsigned Params = Ctor->getNumParams();
+ if (Params >= MinParams) {
+ do
+ declareCtor(UsingLoc, Ctor,
+ SemaRef.Context.getFunctionType(
+ Ctor->getResultType(), ArgTypes.slice(0, Params), EPI));
+ while (Params > MinParams &&
+ Ctor->getParamDecl(--Params)->hasDefaultArg());
+ }
}
/// Find the using-declaration which specified that we should inherit the