re PR c++/52292 ([C++11] Variadic template expansion into fixed template causes constructor to not match)
PR c++/52292 PR c++/52380 * pt.c (coerce_template_parms): Even if we aren't converting we want to expand argument packs. From-SVN: r186481
This commit is contained in:
parent
1c2221a8be
commit
3dc2385227
|
@ -1,3 +1,10 @@
|
|||
2012-04-15 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/52292
|
||||
PR c++/52380
|
||||
* pt.c (coerce_template_parms): Even if we aren't converting we
|
||||
want to expand argument packs.
|
||||
|
||||
2012-04-15 Fabien Chêne <fabien@gcc.gnu.org>
|
||||
|
||||
PR c++/52465
|
||||
|
|
|
@ -6891,7 +6891,7 @@ coerce_template_parms (tree parms,
|
|||
{
|
||||
/* We don't know how many args we have yet, just
|
||||
use the unconverted ones for now. */
|
||||
new_inner_args = args;
|
||||
new_inner_args = inner_args;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
2012-04-15 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/52380
|
||||
* g++.dg/cpp0x/variadic125.C: New.
|
||||
|
||||
PR c++/52292
|
||||
* g++.dg/cpp0x/variadic124.C: New.
|
||||
|
||||
2012-04-15 Fabien Chêne <fabien@gcc.gnu.org>
|
||||
|
||||
PR c++/52465
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
// PR c++/52292
|
||||
// { dg-options -std=c++11 }
|
||||
|
||||
template <template <typename...> class T>
|
||||
struct foo {
|
||||
template <typename... U>
|
||||
foo(T<U...> x) { }
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct bar {
|
||||
bar(T x) : value(x) { }
|
||||
|
||||
T value;
|
||||
};
|
||||
|
||||
struct generic : private foo<bar> {
|
||||
template <typename T>
|
||||
generic(bar<T> x) : foo(x)
|
||||
{
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
bar<int> x(32);
|
||||
generic y(x); // FAILS
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
// PR c++/52380
|
||||
// { dg-do compile { target c++11 } }
|
||||
|
||||
template<typename T>
|
||||
struct S
|
||||
{
|
||||
template<typename U>
|
||||
struct Unary // Line 5
|
||||
{};
|
||||
|
||||
template<unsigned, typename... Args>
|
||||
struct Dispatch // Line 9
|
||||
: public Unary<Args...>
|
||||
{};
|
||||
|
||||
template<typename... Args>
|
||||
struct Variadic
|
||||
: public Dispatch<sizeof...(Args), Args...>
|
||||
{};
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
S<void>::Variadic<void> z;
|
||||
}
|
Loading…
Reference in New Issue