Commit da1512ad by Paolo Carlini Committed by Paolo Carlini

re PR c++/35147 (ICE trying to expand an argument pack with zero arguments)

/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.

From-SVN: r144001
parent feab5a67
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
......
......@@ -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
......
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
......
// { 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();
}
// { dg-options "-std=c++0x" }
void f() { }
template<class U, class... T>
void f(){ f<T...>(); } // { dg-error "no matching" }
int main()
{
f<char>();
}
// { 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>();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment