From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2313 invoked by alias); 2 Aug 2002 02:56:01 -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 2294 invoked by uid 71); 2 Aug 2002 02:56:01 -0000 Resent-Date: 2 Aug 2002 02:56:01 -0000 Resent-Message-ID: <20020802025601.2293.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, carlo@alinoe.com Received: (qmail 31091 invoked by uid 61); 2 Aug 2002 02:53:41 -0000 Message-Id: <20020802025341.31090.qmail@sources.redhat.com> Date: Thu, 01 Aug 2002 19:56:00 -0000 From: carlo@alinoe.com Reply-To: carlo@alinoe.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/7468: prototype "doesn't match" a candidate that is actually a perfect match. X-SW-Source: 2002-08/txt/msg00015.txt.bz2 List-Id: >Number: 7468 >Category: c++ >Synopsis: prototype "doesn't match" a candidate that is actually a perfect match. >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Thu Aug 01 19:56:00 PDT 2002 >Closed-Date: >Last-Modified: >Originator: carlo@alinoe.com >Release: all releases (2.95, 2.96, 3.0.x, 3.1) >Organization: >Environment: >Description: The compiler aborts compilation with an error along the lines off: troep.cc:10: prototype for `bitset::bitset(int (*)[bitset::digits])' does not match any in class `bitset' troep.cc:6: candidate is: bitset::bitset(int (*)[bitset::digits]) >How-To-Repeat: Compile this: template class bitset { public: static int const digits = 4; typedef int foo_t[digits]; bitset(foo_t*); }; template bitset::bitset(foo_t*) { } Note that the error goes away when either 1) the template is removed 2) the static const is removed and '4' is put directly in the typedef 3) the typedef is replaced by a more normal typedef 4) the (foo_t*) is replaced with (foo_t) Very peculiar bug. >Fix: Put the body inside the class declaration. >Release-Note: >Audit-Trail: >Unformatted: