From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8199 invoked by alias); 19 Nov 2001 21:56:00 -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 8168 invoked by uid 71); 19 Nov 2001 21:56:00 -0000 Resent-Date: 19 Nov 2001 21:56:00 -0000 Resent-Message-ID: <20011119215600.8167.qmail@sourceware.cygnus.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, Jaakko Jarvi Received:(qmail 6085 invoked from network); 19 Nov 2001 21:53:52 -0000 Received: from unknown (HELO trillian.osl.iu.edu) (129.79.245.232) by sourceware.cygnus.com with SMTP; 19 Nov 2001 21:53:52 -0000 Received: (from jajarvi@localhost) by trillian.osl.iu.edu (8.11.6/8.11.6/IUCS_2.43) id fAJLrn824204; Mon, 19 Nov 2001 16:53:49 -0500 (EST) Message-Id:<200111192153.fAJLrn824204@trillian.osl.iu.edu> Date: Wed, 14 Nov 2001 10:36:00 -0000 From: Jaakko Jarvi To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:3.113 Subject: c++/4908: Pointer to function type template arguments include default argument info X-SW-Source: 2001-11/txt/msg00314.txt.bz2 List-Id: >Number: 4908 >Category: c++ >Synopsis: Pointer to function type template arguments include default argument info >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: accepts-illegal >Submitter-Id: net >Arrival-Date: Mon Nov 19 13:56:00 PST 2001 >Closed-Date: >Last-Modified: >Originator: Jaakko Jarvi >Release: 3.0.2 >Organization: Indiana University, Computer Science >Environment: System: SunOS trillian.osl.iu.edu 5.8 Generic_108528-09 sun4u sparc SUNW,Sun-Blade-100 Architecture: sun4 host: sparc-sun-solaris2.8 build: sparc-sun-solaris2.8 target: sparc-sun-solaris2.8 configured with: ./configure --prefix=/l/gcc302 >Description: Function default arguments should not be part of the pointer to function type. However, when a type template parameter is instantiated with a pointer to function, information about default arguments seem to lurk in somewhat strangely. The following code compiles and runs: void foo(int i=1); template void call(F f) { f(); } The test program in the How-To-Repeat part is self explaining >How-To-Repeat: #include using namespace std; void foo(int i = 1) { cout << "foo " << i << endl; } void bar(int i) { cout << "bar " << i << endl; } template void call(F f, F g) { f(); g(); } int main() { call(&foo, &bar); return 0; } >Fix: >Release-Note: >Audit-Trail: >Unformatted: