From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28869 invoked by alias); 2 Jan 2012 21:36:29 -0000 Received: (qmail 28781 invoked by uid 22791); 2 Jan 2012 21:36:28 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_KY 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; Mon, 02 Jan 2012 21:36:13 +0000 From: "solodon at mail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/51710] decltype and SFINAE Date: Mon, 02 Jan 2012 21:36: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: X-Bugzilla-Severity: normal X-Bugzilla-Who: solodon at mail dot com X-Bugzilla-Status: RESOLVED 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" 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: 2012-01/txt/msg00167.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51710 --- Comment #3 from Yuriy Solodkyy 2012-01-02 21:35:56 UTC --- Thank you, I am aware of the workaround and that is exactly what I do in my code, however I think the current behavior is counter intuitive: 1. I get error message about instantiation that I have not made myself in the code or expected to be made, but because compiler had failure during substitution in decltype. 2. The error message is missing the instantiation context as in regular cases, which made me wonder for a long time what exactly fails and why, especially since Visual C++ was doing what I expected. 3. The purpose of decltype is now less clear as for each such case I cannot just use decltype, but have to create a dedicated meta-function again, that uses the decltype inside. 4. Once the concept based overloading is there, I expect the function be thrown out of the overload set because the types don't match the concept emulated here with condition. There won't be compilation error then and with this code I am simply trying to emulate the concept-based overloading with tools i have today. Thank you, Yuriy