diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-02-07 02:05:04 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-02-07 02:05:04 +0000 |
commit | 881082e9e3a959338837b2e7b6ef618d6a562f67 (patch) | |
tree | d7dc4df955e233e85f3cf9717534111f6cd9502e /gcc | |
parent | 9e830260e94660768c1afb379b85c1d941771589 (diff) | |
download | gcc-881082e9e3a959338837b2e7b6ef618d6a562f67.tar.gz |
/cp
2009-02-06 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/35147
PR c++/37737
* cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Check TREE_VEC_LENGTH.
/testsuite
2009-02-06 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/35147
PR c++/37737
* g++.dg/cpp0x/vt-35147.C: New.
* g++.dg/cpp0x/vt-37737-1.C: Likewise.
* g++.dg/cpp0x/vt-37737-2.C: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@144001 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/vt-35147.C | 17 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/vt-37737-1.C | 11 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/vt-37737-2.C | 15 |
6 files changed, 59 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 2a08d8bbae4..690334d6e45 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2009-02-06 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/35147 + PR c++/37737 + * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Check TREE_VEC_LENGTH. + 2009-02-04 Jakub Jelinek <jakub@redhat.com> PR c++/39095 diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 186ec9ab6ad..f37c8883688 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -2270,8 +2270,8 @@ extern void decl_shadowed_for_var_insert (tree, tree); /* Nonzero if the template arguments is actually a vector of vectors, rather than just a vector. */ -#define TMPL_ARGS_HAVE_MULTIPLE_LEVELS(NODE) \ - (NODE && TREE_VEC_ELT (NODE, 0) \ +#define TMPL_ARGS_HAVE_MULTIPLE_LEVELS(NODE) \ + (NODE && TREE_VEC_LENGTH (NODE) && TREE_VEC_ELT (NODE, 0) \ && TREE_CODE (TREE_VEC_ELT (NODE, 0)) == TREE_VEC) /* The depth of a template argument vector. When called directly by diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 77e3ff7bd22..7cde83d6c5e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2009-02-06 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/35147 + PR c++/37737 + * g++.dg/cpp0x/vt-35147.C: New. + * g++.dg/cpp0x/vt-37737-1.C: Likewise. + * g++.dg/cpp0x/vt-37737-2.C: Likewise. + 2009-02-06 Joseph Myers <joseph@codesourcery.com> PR c/35434 diff --git a/gcc/testsuite/g++.dg/cpp0x/vt-35147.C b/gcc/testsuite/g++.dg/cpp0x/vt-35147.C new file mode 100644 index 00000000000..67f282ef9c3 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/vt-35147.C @@ -0,0 +1,17 @@ +// { dg-options "-std=c++0x" } + +template<typename _Tp> + _Tp&& forward(_Tp&& __t) { return __t; } + +void f(...); + +template<typename... Args> +void g(Args&&... args) +{ + f(forward<Args...>(args...)); // { dg-error "no matching" } +} + +void h() +{ + g(); +} diff --git a/gcc/testsuite/g++.dg/cpp0x/vt-37737-1.C b/gcc/testsuite/g++.dg/cpp0x/vt-37737-1.C new file mode 100644 index 00000000000..32ea22db278 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/vt-37737-1.C @@ -0,0 +1,11 @@ +// { dg-options "-std=c++0x" } + +void f() { } + +template<class U, class... T> +void f(){ f<T...>(); } // { dg-error "no matching" } + +int main() +{ + f<char>(); +} diff --git a/gcc/testsuite/g++.dg/cpp0x/vt-37737-2.C b/gcc/testsuite/g++.dg/cpp0x/vt-37737-2.C new file mode 100644 index 00000000000..11547e5e249 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/vt-37737-2.C @@ -0,0 +1,15 @@ +// { dg-options "-std=c++0x" } + +template<class U, class... T> +void f() +{ + f<T...>(); // { dg-error "no matching" } +} + +template<> +void f() { } // { dg-error "template-id" } + +int main() +{ + f<char>(); +} |