Commit a7cbc517 by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/38795 (ICE with reinterpret_cast and variadic templates)

	PR c++/38795
	* tree.c (cp_walk_subtrees): Handle REINTERPRET_CAST_EXPR,
	STATIC_CAST_EXPR, CONST_CAST_EXPR and DYNAMIC_CAST_EXPR the same
	as CAST_EXPR.

	* g++.dg/cpp0x/pr38795.C: New test.

From-SVN: r143351
parent 5bdf05c8
2009-01-13 Jakub Jelinek <jakub@redhat.com>
PR c++/38795
* tree.c (cp_walk_subtrees): Handle REINTERPRET_CAST_EXPR,
STATIC_CAST_EXPR, CONST_CAST_EXPR and DYNAMIC_CAST_EXPR the same
as CAST_EXPR.
2009-01-12 Jason Merrill <jason@redhat.com>
Steve Ellcey <sje@cup.hp.com>
......
/* Language-dependent node constructors for parse phase of GNU compiler.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009
Free Software Foundation, Inc.
Hacked by Michael Tiemann (tiemann@cygnus.com)
......@@ -2443,6 +2443,10 @@ cp_walk_subtrees (tree *tp, int *walk_subtrees_p, walk_tree_fn func,
break;
case CAST_EXPR:
case REINTERPRET_CAST_EXPR:
case STATIC_CAST_EXPR:
case CONST_CAST_EXPR:
case DYNAMIC_CAST_EXPR:
if (TREE_TYPE (*tp))
WALK_SUBTREE (TREE_TYPE (*tp));
......
2009-01-13 Jakub Jelinek <jakub@redhat.com>
PR c++/38795
* g++.dg/cpp0x/pr38795.C: New test.
2009-01-13 Daniel Jacobowitz <dan@codesourcery.com>
Nathan Froyd <froydnj@codesourcery.com>
Joseph Myers <joseph@codesourcery.com>
......
// PR c++/38795
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
template<typename... T> int foo(int i)
{
return *reinterpret_cast<T*>(i); // { dg-error "not expanded with|T" }
}
void bar(int i)
{
foo<int>(i);
}
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