From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15647 invoked by alias); 25 Oct 2011 18:09:03 -0000 Received: (qmail 15636 invoked by uid 22791); 25 Oct 2011 18:09:02 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 25 Oct 2011 18:08:48 +0000 From: "daniel.kruegler at googlemail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/50864] [4.6/4.7 Regression] ICE with decltype and "declval" from another namespace Date: Tue, 25 Oct 2011 18:09:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: daniel.kruegler at googlemail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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: 2011-10/txt/msg02589.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D50864 --- Comment #8 from Daniel Kr=C3=BCgler 2011-10-25 18:08:01 UTC --- (In reply to comment #7) > The arrow operator (vs, eg, +) seems also essential. That makes sense to me, because the code could never be valid, so I would suggest that the keyword is changed to ice-on-invalid-code. The proper code namespace impl { template T create(); } template < class lhs, class rhs > struct is_arrow_operable_impl { template ()->*impl::create())> void test(); }; works as expected. I guess the reason for the ICE of the original code is t= hat the compiler runs into a branch where the second impl::create is interprete= d as a member access, which could never be valid, because there is no (base) cla= ss impl.=20 But this is probably only part of the whole story, because if I change the erroneous example to struct impl { template static T create(); }; template < class lhs, class rhs > struct is_arrow_operable_impl { template ()->impl::create()) > void test(); }; I'm getting "internal compiler error: Segmentation fault" without further context information. Note that *this* example *can* lead to valid code when attempting to instantiate is_arrow_operable_impl with impl* and int, respectively, for example.