Commit 4e3f6d85 by Jason Merrill Committed by Jason Merrill

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
parent 8414ab11
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> 2009-12-03 Dodji Seketeli <dodji@redhat.com>
PR c++/42217 PR c++/42217
......
...@@ -506,7 +506,8 @@ convert_to_reference (tree reftype, tree expr, int convtype, ...@@ -506,7 +506,8 @@ convert_to_reference (tree reftype, tree expr, int convtype,
tree tree
convert_from_reference (tree val) 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 t = TREE_TYPE (TREE_TYPE (val));
tree ref = build1 (INDIRECT_REF, t, val); tree ref = build1 (INDIRECT_REF, t, val);
......
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> 2009-12-03 Jakub Jelinek <jakub@redhat.com>
PR middle-end/42049 PR middle-end/42049
......
// 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);
}
};
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