public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/6936: member "using" binds wrong
@ 2002-06-05  9:46 ncm
  0 siblings, 0 replies; 2+ messages in thread
From: ncm @ 2002-06-05  9:46 UTC (permalink / raw)
  To: gcc-gnats


>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:


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: c++/6936: member "using" binds wrong
@ 2002-10-27  7:16 lerdsuwa
  0 siblings, 0 replies; 2+ messages in thread
From: lerdsuwa @ 2002-10-27  7:16 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, ncm, nobody

Synopsis: member "using" binds wrong

State-Changed-From-To: open->analyzed
State-Changed-By: lerdsuwa
State-Changed-When: Sun Oct 27 07:16:56 2002
State-Changed-Why:
    Confirmed.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6936


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-10-27 15:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-05  9:46 c++/6936: member "using" binds wrong ncm
2002-10-27  7:16 lerdsuwa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).