This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/7584: Erroneous ambiguous base error on using declaration
- From: timb at bluearc dot com
- To: gcc-gnats at gcc dot gnu dot org
- Date: 13 Aug 2002 13:58:47 -0000
- Subject: c++/7584: Erroneous ambiguous base error on using declaration
- Reply-to: timb at bluearc dot com
>Number: 7584
>Category: c++
>Synopsis: Erroneous ambiguous base error on using declaration
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Tue Aug 13 07:06:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: timb@bluearc.com
>Release: 3.1.1 (powerpc-eabi)
>Organization:
>Environment:
Debian GNU/Linux x86 unstable
>Description:
When compiling the code below, gcc reports "`A' is an ambiguous base of `C'" for each using declaration, and goes on to complain of "C::T x;" that "`typedef int A::T' is inaccessible". (Incidentally, the ambiguous base messages give the line number of the opening brace of the class definition.) There is no ambiguity for either using declaration, since A is a virtual base class. In the second, there would be no ambiguity even if A were a non-virtual base, since nested types can always be referred to unambiguously (para. 10.2/5).
>How-To-Repeat:
Compile the following with gcc -c
class A
{
public:
typedef int T;
int a;
};
class B : virtual private A
{
};
class C : virtual private A, public B
{
public:
using A::a;
using A::T;
};
C::T x;
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: