From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24045 invoked by alias); 15 May 2003 18:20:45 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 24019 invoked by uid 48); 15 May 2003 18:20:45 -0000 Date: Thu, 15 May 2003 18:20:00 -0000 Message-ID: <20030515182045.24013.qmail@sources.redhat.com> To: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, giovannibajo@libero.it, nathan@codesourcery.com, nobody@gcc.gnu.org From: giovannibajo@libero.it Reply-To: giovannibajo@libero.it, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, giovannibajo@libero.it, nathan@codesourcery.com, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: c++/3518: [2003-05-03] default conversion to pointer-to-function is applied to soon (related to DR295) X-SW-Source: 2003-05/txt/msg01812.txt.bz2 List-Id: Old Synopsis: [2003-05-03] default conversion applied too soon New Synopsis: [2003-05-03] default conversion to pointer-to-function is applied to soon (related to DR295) State-Changed-From-To: feedback->analyzed State-Changed-By: bajo State-Changed-When: Thu May 15 18:20:44 2003 State-Changed-Why: Ok. I have submitted a new PR (c++/10807) with a testcase suming up the whole DR295. This PR is directly related: probably when DR295 is implemented correctly, this PR will be fixed as well. Anyway, the final testcase for this PR is: ----------------------------------------------- template struct check_not_pointer {}; template struct check_not_pointer; struct any { template any (const T&) { check_not_pointer dummy; } }; template any Foo (const T &s) { return s; } void f () {} int main() { Foo (f); } ----------------------------------------------- pr3518.cpp: In constructor `any::any(const T&) [with T = void (*)()]': pr3518.cpp:17: instantiated from `any Foo(T&) [with T = void ()()]' pr3518.cpp:25: instantiated from here pr3518.cpp:11: error: `dummy' has incomplete type pr3518.cpp:11: error: storage size of `dummy' isn't known It fails because any::any should be instantiates with [T = void (void)], while it gets instantiated with [T = void(*)(void)] because the default conversion is applied too soon (and DR295 is not implemented). http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=3518