From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8666 invoked by alias); 29 Apr 2002 18:06:02 -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 8646 invoked by uid 71); 29 Apr 2002 18:06:01 -0000 Resent-Date: 29 Apr 2002 18:06:01 -0000 Resent-Message-ID: <20020429180601.8645.qmail@sources.redhat.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, yap_noel@olf.com Received:(qmail 4810 invoked by uid 61); 29 Apr 2002 17:57:14 -0000 Message-Id:<20020429175714.4809.qmail@sources.redhat.com> Date: Mon, 29 Apr 2002 11:06:00 -0000 From: yap_noel@olf.com Reply-To: yap_noel@olf.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/6508: compilation error when using "min< double >" as function parameter X-SW-Source: 2002-04/txt/msg01605.txt.bz2 List-Id: >Number: 6508 >Category: c++ >Synopsis: compilation error when using "min< double >" as function parameter >Confidential: no >Severity: non-critical >Priority: medium >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Mon Apr 29 11:06:00 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Noel Yap >Release: gcc 2.95 and 3.0.3 >Organization: >Environment: CYGWIN_NT-5.0 OLFDEV1 1.3.10(0.51/3/2) 2002-02-25 11:14 i686 unknown >Description: When I try to call a function with a parameter of "min< double >", it complains with the error: no matching function for call to `matrix_min_path (Matrix &, plus, {unknown type})' >How-To-Repeat: g++ -g -I /home/nyap/opt/mtl-2.1.2.20/include -Wall asdf.cc -o asdf where asdf.cc contains: #include template < typename BinaryFn > void test(BinaryFn fn) { fn(0, 1); } int main(int argc, char *argv[]) { test(min< double >); } >Fix: The following is a workaround: #include template < typename BinaryFn > void test(BinaryFn fn) { fn(0, 1); } int main(int argc, char *argv[]) { const double &(*minFn)(const double &, const double &) = min< double >; test(minFn); } >Release-Note: >Audit-Trail: >Unformatted: