From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2733 invoked by alias); 21 Dec 2009 14:28:11 -0000 Received: (qmail 2708 invoked by uid 48); 21 Dec 2009 14:27:59 -0000 Date: Mon, 21 Dec 2009 14:28:00 -0000 Message-ID: <20091221142759.2707.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/42447] [C++0x] ICE during processing complex templates In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "piotr dot wyderski at gmail 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/msg02010.txt.bz2 ------- Comment #5 from piotr dot wyderski at gmail dot com 2009-12-21 14:27 ------- (In reply to comment #4) > Certainly *is* a problem if we hope to debug the issue decently fast... > I meant "the cause of the problem is in its size", i.e. there must be a critical mass of templates to trigger the issue. There probably is no problem in std::unique_ptr on its own; to me it seems to be a "random victim" of something strange happening under the hood. As I said, I am not able to shrink it down in a reasonable way. For example, this simplified testcase compiles flawlessly: #include struct release_deleter { template void operator()(T* p) { static_assert(std::is_pod::value || std::is_same::value, "T must be a POD type or void"); } }; template class dynamic_dispatch; template < typename TC, typename TR, typename TD, typename... TA > class dynamic_dispatch { class entry {}; typedef std::unique_ptr entry_ptr; public: template 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::attach_handler(TR (UC::*m)(UD&, TA...)) { }; class C { public: void M(int&); }; dynamic_dispatch dd; int main() { dd.attach_handler(&C::M); } But the problem is definitely related to template processing. If you comment out the folowing line (at the very bottom of the attached file, in the constructor): attach_handler(static_cast&)> (&file_reader::execute_command)); it compiles OK. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42447