re PR c++/55232 ([C++11] ICE with -Wunused-parameter for unused parameter pack using qualified dependent name)

PR c++/55232
	* error.c (find_typenames_r): Don't walk into a pack expansion.

From-SVN: r196064
This commit is contained in:
Jason Merrill 2013-02-14 20:26:34 -05:00 committed by Jason Merrill
parent 9c85798a59
commit ff9b4073cc
3 changed files with 36 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2013-02-14 Jason Merrill <jason@redhat.com>
PR c++/55232
* error.c (find_typenames_r): Don't walk into a pack expansion.
2013-02-13 Jason Merrill <jason@redhat.com>
PR c++/55670

View File

@ -1283,7 +1283,7 @@ struct find_typenames_t
};
static tree
find_typenames_r (tree *tp, int * /*walk_subtrees*/, void *data)
find_typenames_r (tree *tp, int *walk_subtrees, void *data)
{
struct find_typenames_t *d = (struct find_typenames_t *)data;
tree mv = NULL_TREE;
@ -1296,6 +1296,14 @@ find_typenames_r (tree *tp, int * /*walk_subtrees*/, void *data)
/* Add the typename without any cv-qualifiers. */
mv = TYPE_MAIN_VARIANT (*tp);
if (TREE_CODE (*tp) == TYPE_PACK_EXPANSION)
{
/* Don't mess with parameter packs since we don't remember
the pack expansion context for a particular typename. */
*walk_subtrees = false;
return NULL_TREE;
}
if (mv && (mv == *tp || !pointer_set_insert (d->p_set, mv)))
vec_safe_push (d->typenames, mv);

View File

@ -0,0 +1,22 @@
// PR c++/55232
// { dg-do compile { target c++11 } }
struct vector
{
typedef int value_type;
};
template< class U, class... T >
struct X
{
void push_back( typename T::value_type ... vals )
{
U::asoeuth; // { dg-error "" }
}
};
int main()
{
X< int, vector > x;
x.push_back( 0 );
}