From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30929 invoked by alias); 21 Dec 2009 20:29:17 -0000 Received: (qmail 30898 invoked by uid 48); 21 Dec 2009 20:29:05 -0000 Date: Mon, 21 Dec 2009 20:29:00 -0000 Message-ID: <20091221202905.30897.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/42447] [4.5 Regresson] ICE during processing complex templates In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "paolo dot carlini at oracle dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2009-12/txt/msg02040.txt.bz2 ------- Comment #13 from paolo dot carlini at oracle dot com 2009-12-21 20:29 ------- A tad simpler: template void* get(int); template struct unique_ptr; template struct unique_ptr<_Tp[]> { typedef int __tuple_type; void* get() const { return ::get<0>(_M_t); } __tuple_type _M_t; }; template class dynamic_dispatch; template struct dynamic_dispatch { struct entry { }; unique_ptr m_Start; template void attach_handler(void (UC::*m)(int&)) { entry* p = 0; do { } while(--p != m_Start.get()); } }; template class request_dispatcher : private dynamic_dispatch { request_dispatcher(); }; struct file_reader { void execute_command(int&); }; template <> request_dispatcher::request_dispatcher() { this->attach_handler(&file_reader::execute_command); } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42447