diff options
author | Douglas Gregor <doug.gregor@gmail.com> | 2007-11-02 03:26:46 +0000 |
---|---|---|
committer | Doug Gregor <dgregor@gcc.gnu.org> | 2007-11-02 03:26:46 +0000 |
commit | e1a18c68eba04c396dd491a361aeef15f73e8b05 (patch) | |
tree | 5be65ddecf81b1bd2c74b9ad4a000666f66ffee7 | |
parent | a19309466aefbc363454c0c6bb41de3e0ee13c69 (diff) | |
download | gcc-e1a18c68eba04c396dd491a361aeef15f73e8b05.zip gcc-e1a18c68eba04c396dd491a361aeef15f73e8b05.tar.gz gcc-e1a18c68eba04c396dd491a361aeef15f73e8b05.tar.bz2 |
re PR c++/33955 (internal compiler error: in dependent_type_p, at cp/pt.c:15245 (vararg template problem))
2007-11-01 Douglas Gregor <doug.gregor@gmail.com>
PR c++/33955
* pt.c (find_parameter_packs_r): Handle TYPENAME_TYPE.
2007-11-01 Douglas Gregor <doug.gregor@gmail.com>
* g++.dg/cpp0x/pr33955.C: New.
From-SVN: r129843
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/pt.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/pr33955.C | 39 |
4 files changed, 56 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 51f219b..c784c31 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2007-11-01 Douglas Gregor <doug.gregor@gmail.com> + + PR c++/33955 + * pt.c (find_parameter_packs_r): Handle TYPENAME_TYPE. + 2007-11-01 Jakub Jelinek <jakub@redhat.com> PR c++/32384 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 5f6e296..8f72ba9 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -2504,7 +2504,14 @@ find_parameter_packs_r (tree *tp, int *walk_subtrees, void* data) *walk_subtrees = 0; return NULL_TREE; - + + case TYPENAME_TYPE: + cp_walk_tree (&TYPENAME_TYPE_FULLNAME (t), &find_parameter_packs_r, + ppd, ppd->visited); + *walk_subtrees = 0; + return NULL_TREE; + + case TYPE_PACK_EXPANSION: case EXPR_PACK_EXPANSION: *walk_subtrees = 0; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b1c5701..459d5a2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2007-11-01 Douglas Gregor <doug.gregor@gmail.com> + + * g++.dg/cpp0x/pr33955.C: New. + 2007-11-01 Tom Tromey <tromey@redhat.com> PR preprocessor/30805: diff --git a/gcc/testsuite/g++.dg/cpp0x/pr33955.C b/gcc/testsuite/g++.dg/cpp0x/pr33955.C new file mode 100644 index 0000000..cde92de --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr33955.C @@ -0,0 +1,39 @@ +// { dg-options "-std=c++0x" } +template<typename T> +struct uncvref +{ + typedef T type; +}; + +template<typename... Args> +struct args +{ + static const int size = sizeof...(Args); +}; + +template<typename G, typename E, typename S, typename V, long GN = G::size, long EN = E::size> +struct apply_args; + +template<typename... G, typename... E, typename S, typename V, long N> +struct apply_args<args<G...>, args<E...>, S, V, N, N> +{ + typedef args< + typename G::template apply<typename uncvref<E>::type, S, V>::type... + > type; +}; + +struct or_ +{ + template<typename E, typename S, typename V> + struct apply { + typedef typename E::type type; + }; +}; + +template<typename T> +struct identity +{ + typedef T type; +}; + +apply_args<args<or_>, args<identity<int>>, float, double> a1; |