diff options
author | Dodji Seketeli <dodji@redhat.com> | 2013-05-16 06:14:49 +0000 |
---|---|---|
committer | Dodji Seketeli <dodji@gcc.gnu.org> | 2013-05-16 08:14:49 +0200 |
commit | f5b6d0d1d2cf80e685084eedd5ce68370a6f4248 (patch) | |
tree | c6b464617b7d00a515b81b19e8d79595d99f21d2 /gcc/fold-const.c | |
parent | ad56ed7ebca514b172e13172f2486951218d3c8b (diff) | |
download | gcc-f5b6d0d1d2cf80e685084eedd5ce68370a6f4248.zip gcc-f5b6d0d1d2cf80e685084eedd5ce68370a6f4248.tar.gz gcc-f5b6d0d1d2cf80e685084eedd5ce68370a6f4248.tar.bz2 |
PR c++/56782 - Regression with empty pack expansions
In the example of the patch below, during the instantiation of
is_convertible at #1, we see at some point Tuple<>. (Let's note '{}'
an empty argument pack.) In that context, during the partial
specialization the member template
template<class... U>
Tuple<>::Tuple<U,
typename enable_if<and_<is_convertible<U, {}>...
>::value,
int
>::type
>
Let's look at what happens to the expansion "is_convertible<U, {}>...."
To express the result of that expansion tsubst_pack_expansion receives
the expansion is_convertible<U, T>, with the argument list [{}]. This
function should detect that we have an empty argument pack for the
parameter pack T and no argument pack for the parameter pack U. It
should thus return a pack expansion "is_convertible<U,T>..." that has this
information: "I have gotten an argument list, that is not complete
because U doesn't have any argument pack; the argument pack for T is
'{}', so I'll wait for the next time I am passed to
tsubst_pack_expansion with enough additional argument packs, to really
perform the substitution". That information is conveyed by attaching
the the '{}' to the PACK_EXPANSION_EXTRA property of the pack expansion
returned by tsubst_pack_expansion.
The problem in this report is that we are not setting
PACK_EXPANSION_EXTRA when the non-complete argument pack list is made
of an empty argument pack, because use_pack_expansion_extra_args_p
doesn't detect this case.
Fixed thus.
gcc/cp/
* pt.c (use_pack_expansion_extra_args_p): When at least a
parameter pack has an empty argument pack, and another parameter
pack has no argument pack at all, use the PACK_EXPANSION_EXTRA
mechanism.
From-SVN: r198956
Diffstat (limited to 'gcc/fold-const.c')
0 files changed, 0 insertions, 0 deletions