This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/32039] New: Using declaration accepts non-visible members from base classes
- From: "andrew dot stubbs at st dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 May 2007 12:07:05 -0000
- Subject: [Bug c++/32039] New: Using declaration accepts non-visible members from base classes
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following code should not compile:
struct A
{
int foo(int);
};
struct B : public A
{
int foo(long);
// using A::foo; // This would make it visible
};
struct C : public B
{
using A::foo; // A::foo should not be visible
};
The problem should be that B::foo hides A::foo from class C. Clause 7.3.3/14 of
the C++ standard says the using declaration should not work, in this case -
class A is not a direct base class of class C. However, GCC 4.1.1 accepts it
with no diagnostic.
--
Summary: Using declaration accepts non-visible members from base
classes
Product: gcc
Version: 4.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: andrew dot stubbs at st dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32039