mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-23 09:29:20 +08:00
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:
parent
9c85798a59
commit
ff9b4073cc
@ -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
|
||||
|
@ -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);
|
||||
|
||||
|
22
gcc/testsuite/g++.dg/cpp0x/variadic-diag1.C
Normal file
22
gcc/testsuite/g++.dg/cpp0x/variadic-diag1.C
Normal 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 );
|
||||
}
|
Loading…
Reference in New Issue
Block a user