From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27139 invoked by alias); 1 Jul 2002 11:56:05 -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 27096 invoked by uid 71); 1 Jul 2002 11:56:05 -0000 Resent-Date: 1 Jul 2002 11:56:05 -0000 Resent-Message-ID: <20020701115605.27094.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, nmusatti@comm2000.it Received: (qmail 22957 invoked by uid 61); 1 Jul 2002 11:49:21 -0000 Message-Id: <20020701114921.22956.qmail@sources.redhat.com> Date: Mon, 01 Jul 2002 04:56:00 -0000 From: nmusatti@comm2000.it Reply-To: nmusatti@comm2000.it To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/7176: g++ confused by friend and static member with same name X-SW-Source: 2002-07/txt/msg00007.txt.bz2 List-Id: >Number: 7176 >Category: c++ >Synopsis: g++ confused by friend and static member with same name >Confidential: no >Severity: non-critical >Priority: medium >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Mon Jul 01 04:56:03 PDT 2002 >Closed-Date: >Last-Modified: >Originator: nmusatti@comm2000.it >Release: GNU C++ version 3.1 (i686-pc-cygwin) >Organization: >Environment: >Description: The following preprocessed source should compile without errors, but doesn't: # 1 "DateTimeNS.cpp" # 1 "" # 1 "" # 1 "DateTimeNS.cpp" namespace Test { template inline Result convert(Value v) { return Result(v); } class DateTime { friend DateTime Test::convert(long); static long convert(const long double & v); }; template <> inline DateTime convert(long v) { return DateTime(); } long DateTime::convert(const long double & v) { return long(v); } } The error messages are: DateTimeNS.cpp:9: declaration of `static long int Test::DateTime::convert(const long double&)' DateTimeNS.cpp:3: changes meaning of `convert' from `Result Test::convert(Value)' >How-To-Repeat: Save the attached code without the first four lines in a source file, say a.cpp; run g++ -c a.cpp >Fix: >Release-Note: >Audit-Trail: >Unformatted: