re PR c++/42266 ([C++0x] ICE with decltype and variadic templates)

PR c++/42266
	* cvt.c (convert_from_reference): Do nothing if TREE_TYPE is null.

From-SVN: r154964
This commit is contained in:
Jason Merrill 2009-12-03 19:26:27 -05:00 committed by Jason Merrill
parent 8414ab1197
commit 4e3f6d8529
4 changed files with 47 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2009-12-03 Jason Merrill <jason@redhat.com>
PR c++/42266
* cvt.c (convert_from_reference): Do nothing if TREE_TYPE is null.
2009-12-03 Dodji Seketeli <dodji@redhat.com>
PR c++/42217

View File

@ -506,7 +506,8 @@ convert_to_reference (tree reftype, tree expr, int convtype,
tree
convert_from_reference (tree val)
{
if (TREE_CODE (TREE_TYPE (val)) == REFERENCE_TYPE)
if (TREE_TYPE (val)
&& TREE_CODE (TREE_TYPE (val)) == REFERENCE_TYPE)
{
tree t = TREE_TYPE (TREE_TYPE (val));
tree ref = build1 (INDIRECT_REF, t, val);

View File

@ -1,3 +1,8 @@
2009-12-03 Jason Merrill <jason@redhat.com>
PR c++/42266
* g++.dg/cpp0x/variadic97.C: New.
2009-12-03 Jakub Jelinek <jakub@redhat.com>
PR middle-end/42049

View File

@ -0,0 +1,35 @@
// PR c++/42266
// { dg-options -std=c++0x }
template<typename... _Elements>
class tuple;
template<typename _Arg>
class _Mu;
template<typename _Signature>
struct _Bind;
template<typename _Functor, typename... _Bound_args>
class _Bind<_Functor(_Bound_args...)>
{
template<typename... _Args, typename
= decltype(_Functor()(_Mu<_Bound_args>()(_Bound_args(),
tuple<_Args...>())...) )>
void __call() { }
};
template<typename _Functor, typename _Arg>
_Bind<_Functor(_Arg)>
bind(_Functor, _Arg) { }
struct State
{
bool ready() { return true; }
void f()
{
bind(&State::ready, this);
}
};