Bug 42266 - [C++0x] ICE with decltype and variadic templates
Summary: [C++0x] ICE with decltype and variadic templates
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.5.0
: P3 normal
Target Milestone: ---
Assignee: Jason Merrill
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-03 18:12 UTC by Paolo Carlini
Modified: 2009-12-04 16:40 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2009-12-03 22:09:51


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paolo Carlini 2009-12-03 18:12:03 UTC
I tried to reduce as much as possible (maybe too much, we'll see...) an issue which is blocking our work on std::bind. Note, the problem disappears if I simplify the testcase further to not use variadic templates while keeping the rest unchanged.

Jason, can you help us?

//////////////////

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);
  }
};
Comment 1 Jason Merrill 2009-12-04 00:26:45 UTC
Subject: Bug 42266

Author: jason
Date: Fri Dec  4 00:26:27 2009
New Revision: 154964

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=154964
Log:
	PR c++/42266
	* cvt.c (convert_from_reference): Do nothing if TREE_TYPE is null.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/variadic97.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cvt.c
    trunk/gcc/testsuite/ChangeLog

Comment 2 Paolo Carlini 2009-12-04 08:50:44 UTC
Thanks Jason, it looks like the larger testcases we have also build fine now!
Comment 3 Jason Merrill 2009-12-04 16:40:26 UTC
Fixed.