This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/42447] [C++0x] ICE during processing complex templates



------- Comment #10 from piotr dot wyderski at gmail dot com  2009-12-21 17:23 -------
(In reply to comment #9)
> Thus, are you sure the code is valid, before anything else?

It compiles and works on gcc version 4.5.0 20090604.

The current compiler is 

Configured with: ../configure --prefix=/opt/gcc-trunk -v --enable-bootstrap
--en
able-version-specific-runtime-libs --enable-shared --enable-shared-libgcc
--with
-gnu-ld --with-gnu-as --enable-dwarf2-exceptions --disable-symvers
--disable-nls
 --with-arch=core2 --with-tune=generic --enable-threads=posix
--enable-languages
=c,c++
Thread model: posix
gcc version 4.5.0 20091217 (experimental) (GCC)

And here's the reduced testcase:

------------------8<------------------

namespace std
  template<typename _Tp>
    struct __add_ref<_Tp&>
    { typedef _Tp& type; };
    class tuple<>
    {
    };
  template<typename _T1, typename _T2>
    {
      {
      }
    };
  template<std::size_t __i, typename... _Elements>
    inline typename __add_ref<
                    >::type
    get(tuple<_Elements...>& __t)
    {
    }
}
    struct _Fnv_hash<4>
    {
      {
      }
    };
namespace std {
  template <class _OutputIterator, class _Tp>
    {
  {
    {
    }
    {
 {
      }
    }
  };
}
  template <typename _Tp, typename _Tp_Deleter = default_delete<_Tp> >
    class unique_ptr
    {
      reset(pointer __p = pointer())
      {
   {
   }
      }
      {
      }
  };
  template<typename _Tp, typename _Tp_Deleter>
    class unique_ptr<_Tp[], _Tp_Deleter>
    {
      typedef std::tuple<_Tp*, _Tp_Deleter> __tuple_type;
      get() const
      { return std::get<0>(_M_t); }
      __tuple_type _M_t;
  };
namespace base {
    struct release_deleter {
        template <class T> void operator()(T* p) {
        }
    };
    template <typename T> class dynamic_dispatch;
    template <
        typename TC,
        typename TR,
        typename TD,
        typename... TA
    > class dynamic_dispatch<TR (TC::*)(TD&, TA...)> {
        struct entry {
        };
        typedef std::unique_ptr<entry[], release_deleter> entry_ptr;
        entry_ptr m_Start;
        template <typename UC, typename UD> void attach_handler(TR
(UC::*m)(UD&, TA...));
    };
    template <
        typename TC,
        typename TR,
        typename TD,
        typename... TA
    > template <
        typename UC,
        typename UD
    > void dynamic_dispatch<TR (TC::*)(TD&, TA...)>::attach_handler(TR
(UC::*m)(UD&, TA...)) {
        entry* p = m_Cursor;
        if (p != m_Start.get()) {
            } while(--p != m_Start.get());
        }
    class __attribute__((dllexport)) request {
    };
    template <std::size_t N_CHID> class read_request : public read_request_base
{
    };
    template <typename TC> class request_dispatcher
      : private base::dynamic_dispatch<void (TC::*)(request&)> {
        request_dispatcher();
    };
    class __attribute__((dllexport)) device {
        struct __attribute__((dllexport)) control_block : public OVERLAPPED {
            explicit control_block(request& req) {
            }
        };
    };
    class __attribute__((dllexport)) file_reader : public physical_device {
        void execute_command(read_request<0>& req);
    };
    template <> request_dispatcher<file_reader>::request_dispatcher()
      : super(&file_reader::report_unsupported_request) {
        attach_handler(&file_reader::execute_command); 


-- 

piotr dot wyderski at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |major


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]