From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11510 invoked by alias); 5 Jun 2002 16:46: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 11489 invoked by uid 71); 5 Jun 2002 16:46:00 -0000 Resent-Date: 5 Jun 2002 16:46:00 -0000 Resent-Message-ID: <20020605164600.11488.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, ncm@cantrip.org Received:(qmail 11064 invoked from network); 5 Jun 2002 16:44:36 -0000 Received: from unknown (HELO mta.itasoftware.com) (63.107.91.101) by sources.redhat.com with SMTP; 5 Jun 2002 16:44:36 -0000 Received: from ipc (mail@ipc [192.168.1.194]) by mta.itasoftware.com (8.11.6/8.11.6) with ESMTP id g55GiYw07987 for ; Wed, 5 Jun 2002 12:44:34 -0400 Received: from ncm by ipc with local (Exim 3.34 #1 (Debian)) id 17Fdth-0001F9-00 for ; Wed, 05 Jun 2002 12:44:33 -0400 Message-Id: Date: Wed, 05 Jun 2002 09:46:00 -0000 From: ncm@cantrip.org Reply-To: ncm@cantrip.org To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:3.113 Subject: c++/6936: member "using" binds wrong X-SW-Source: 2002-06/txt/msg00121.txt.bz2 List-Id: >Number: 6936 >Category: c++ >Synopsis: member "using" binds wrong >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Wed Jun 05 09:46:00 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Nathan Myers >Release: 3.1.1 20020515 (prerelease) >Organization: >Environment: System: Linux ipc 2.4.19-pre4 #3 SMP Fri Mar 29 02:57:10 EST 2002 i686 unknown Architecture: i686 host: i686-pc-linux-gnu build: i686-pc-linux-gnu target: i686-pc-linux-gnu configured with: ../gcc-3.1/configure --enable-languages=c,c++ --enable-threads=posix --prefix=/ncm/gnu-3.1 --enable-concept-checks >Description: A member "using" declaration fails to override an inherited matching name. As a result, in the example below, the compiler reports a type error. The access-adjustment ("private:") adds a further wrinkle. According to the current standard, it should be ignored, and seems to be now, but if the using-declaration really becomes enough of a declaration to hide the inherited ``void i()'', it had better not become enough of a declaration to be private, too. >How-To-Repeat: $ cat /tmp/a.cc struct Baser { enum { j, i }; }; struct Base : Baser { static void j() {} static void i() {} }; struct Derv : Base { using Baser::j; private: using Baser::i; }; int k = Derv::j; int l = Derv::i; $ g++ -v -c /tmp/a.cc Reading specs from /ncm/gnu-3.1/lib/gcc-lib/i686-pc-linux-gnu/3.1.1/specs Configured with: ../gcc-3.1/configure --enable-languages=c,c++ --enable-threads=posix --prefix=/ncm/gnu-3.1 --enable-concept-checks Thread model: posix gcc version 3.1.1 20020515 (prerelease) /ncm/gnu-3.1/lib/gcc-lib/i686-pc-linux-gnu/3.1.1/cc1plus -v -D__GNUC__=3 -D__GNUC_MINOR__=1 -D__GNUC_PATCHLEVEL__=1 -D__ELF__ -Dunix -D__gnu_linux__ -Dlinux -D__ELF__ -D__unix__ -D__gnu_linux__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -D_GNU_SOURCE -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ /tmp/a.cc -D__GNUG__=3 -D__DEPRECATED -D__EXCEPTIONS -D__GXX_ABI_VERSION=100 -quiet -dumpbase a.cc -version -o /tmp/ccIMt85B.s GNU CPP version 3.1.1 20020515 (prerelease) (cpplib) (i386 Linux/ELF) GNU C++ version 3.1.1 20020515 (prerelease) (i686-pc-linux-gnu) compiled by GNU C version 3.1 20020422 (prerelease). ignoring nonexistent directory "/ncm/gnu-3.1/i686-pc-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /ncm/gnu-3.1/include/g++-v3 /ncm/gnu-3.1/include/g++-v3/i686-pc-linux-gnu /ncm/gnu-3.1/include/g++-v3/backward /usr/local/include /ncm/gnu-3.1/include /ncm/gnu-3.1/lib/gcc-lib/i686-pc-linux-gnu/3.1.1/include /usr/include End of search list. /tmp/a.cc:8: invalid conversion from `void (*)()' to `int' /tmp/a.cc:9: invalid conversion from `void (*)()' to `int' >Fix: >Release-Note: >Audit-Trail: >Unformatted: