This is the mail archive of the
mailing list for the GCC project.
Re: [C++ Patch] PR 57397
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Jason Merrill <jason at redhat dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 29 Jul 2014 18:23:35 +0200
- Subject: Re: [C++ Patch] PR 57397
- Authentication-results: sourceware.org; auth=none
- References: <53D7AF73 dot 2020507 at oracle dot com> <53D7C566 dot 9080509 at redhat dot com>
On 07/29/2014 06:01 PM, Jason Merrill wrote:
On 07/29/2014 10:28 AM, Paolo Carlini wrote:
+unify_arity (bool explain_p, int have, int wanted, bool lb_p = false)
I don't understand "lb_p".
lower_bound ;) The first name which came to my mind...
Yeah, that is exactly for the cases I was mentioning at the end of the
my first message, eg:
@@ -16598,6 +16608,8 @@ type_unification_real (tree tparms,
tree parmvec = make_tree_vec (1);
+ remaining_pack_p = true;
/* Allocate a TREE_VEC and copy in all of the arguments */
argvec = make_tree_vec (nargs - ia);
for (i = 0; ia < nargs; ++ia, ++i)
Why would we get here in the too few args case? Won't we only hit
this code if we had enough args for the non-pack parms?
template<class T1, class... T2, class... T3>
void boo(T1, T2..., T3...)
the patch as-is leads to a diagnostic similar to the current one, thus
saying: "candidate expects at least 2 arguments, 1 provided" whereas the
current one says: "candidate expects 2 arguments, 1 provided". That
seems fine, given the current status, because indeed, passing:
or, for that matter:
boo(1, 2, 3);
are both accepted.