The following triggers an ICE when forwarded_foo is a template.

================================================================

#include <utility>

template< typename Type >
Type& lvalue_of();

char foo( int );

// Note: void is just a dummy type, any argument causes error.
template< typename = void >
class forwarded_foo
{
public:
  template< typename ... Param >
  decltype( foo( std::forward< Param >( lvalue_of< Param >() )... ) )
  operator ()( Param&&... arg ) const;
};

int main()
{
  forwarded_foo<> bar;
  bar( 0 );
}

================================================================

../main.cpp: In instantiation of ‘forwarded_foo<void>’:
../main.cpp:20:   instantiated from here
../main.cpp:15: internal compiler error: in tsubst, at cp/pt.c:9421


-- 
           Summary: ICE with forwarding variadic function template in class
                    template
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mcalabrese_gp at hotmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36236

Reply via email to