mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-22 15:00:55 +08:00
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:
parent
8414ab1197
commit
4e3f6d8529
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
35
gcc/testsuite/g++.dg/cpp0x/variadic97.C
Normal file
35
gcc/testsuite/g++.dg/cpp0x/variadic97.C
Normal 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);
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user