mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-03 09:10:36 +08:00
re PR c++/40092 ([c++0x] expansion pattern fails with error about derived template instead of actual template)
PR c++/40092 * tree.c (cp_tree_equal): Add test for TEMPLATE_PARM_PARAMETER_PACK equality. From-SVN: r152751
This commit is contained in:
parent
a743523c38
commit
9524f7104a
gcc
@ -1,3 +1,9 @@
|
||||
2009-10-14 Larry Evans <cppljevans@suddenlink.net>
|
||||
|
||||
PR c++/40092
|
||||
* tree.c (cp_tree_equal): Add test for TEMPLATE_PARM_PARAMETER_PACK
|
||||
equality.
|
||||
|
||||
2009-10-12 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/37875
|
||||
|
@ -2081,6 +2081,8 @@ cp_tree_equal (tree t1, tree t2)
|
||||
case TEMPLATE_PARM_INDEX:
|
||||
return (TEMPLATE_PARM_IDX (t1) == TEMPLATE_PARM_IDX (t2)
|
||||
&& TEMPLATE_PARM_LEVEL (t1) == TEMPLATE_PARM_LEVEL (t2)
|
||||
&& (TEMPLATE_PARM_PARAMETER_PACK (t1)
|
||||
== TEMPLATE_PARM_PARAMETER_PACK (t2))
|
||||
&& same_type_p (TREE_TYPE (TEMPLATE_PARM_DECL (t1)),
|
||||
TREE_TYPE (TEMPLATE_PARM_DECL (t2))));
|
||||
|
||||
|
@ -1,3 +1,7 @@
|
||||
2009-10-14 Larry Evans <cppljevans@suddenlink.net>
|
||||
|
||||
* g++.dg/cpp0x/vt-40092.C: New.
|
||||
|
||||
2009-10-14 Alexandre Oliva <aoliva@redhat.com>
|
||||
|
||||
* gcc.dg/guality/pr41616-1.c: Drop -O2.
|
||||
|
21
gcc/testsuite/g++.dg/cpp0x/vt-40092.C
Normal file
21
gcc/testsuite/g++.dg/cpp0x/vt-40092.C
Normal file
@ -0,0 +1,21 @@
|
||||
// { dg-do "compile" }
|
||||
// { dg-options "-std=c++0x" }
|
||||
|
||||
template <typename... Types> struct package {};
|
||||
|
||||
template <int ArgGen> struct wrapper_gen {};
|
||||
|
||||
template <int ArgNest> struct wrapper_nest
|
||||
{
|
||||
typedef wrapper_gen<ArgNest> type_nest;
|
||||
};
|
||||
|
||||
template <int... ArgPack>
|
||||
struct wrapper_pack
|
||||
{
|
||||
typedef package<wrapper_gen <ArgPack>...> type_pack;
|
||||
// incorrect error: expansion pattern 'wrapper_gen<ArgNest>'
|
||||
// contains no argument packs
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user