re PR c++/56060 (ICE on invalid code in type_dependent_expression_p, at cp/pt.c:19742)

/cp
2013-10-06  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/56060
	* pt.c (type_dependent_expression_p): Handle EXPR_PACK_EXPANSION.

/testsuite
2013-10-06  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/56060
	* g++.dg/cpp0x/variadic144.C: New.

From-SVN: r203229
This commit is contained in:
Paolo Carlini 2013-10-06 14:43:07 +00:00 committed by Paolo Carlini
parent c3ddbdce59
commit fef7e16b3f
4 changed files with 29 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2013-10-06 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/56060
* pt.c (type_dependent_expression_p): Handle EXPR_PACK_EXPANSION.
2013-10-04 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58560

View File

@ -20403,6 +20403,10 @@ type_dependent_expression_p (tree expression)
if (TREE_CODE (expression) == SCOPE_REF)
return false;
/* Always dependent, on the number of arguments if nothing else. */
if (TREE_CODE (expression) == EXPR_PACK_EXPANSION)
return true;
if (BASELINK_P (expression))
expression = BASELINK_FUNCTIONS (expression);

View File

@ -1,3 +1,8 @@
2013-10-06 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/56060
* g++.dg/cpp0x/variadic144.C: New.
2013-10-04 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58560

View File

@ -0,0 +1,15 @@
// PR c++/56060
// { dg-do compile { target c++11 } }
template<typename T> struct baz { };
template<typename T> T bar();
template<typename T, typename ... U>
baz<decltype(bar<T>()(bar<U> ...))> // { dg-error "cannot be used" }
foo();
int main()
{
foo<int>(); // { dg-error "no matching" }
return 0;
}