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). Release: 3.1.1 (powerpc-eabi) Environment: Debian GNU/Linux x86 unstable 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: http://gcc.gnu.org/ml/gcc-patches/2002-10/msg01074.html
State-Changed-From-To: open->analyzed State-Changed-Why: confirmed as a regression
Responsible-Changed-From-To: unassigned->mmitchel Responsible-Changed-Why: Working on a fix.
State-Changed-From-To: analyzed->closed State-Changed-Why: Fixed in GCC 3.2.1.
From: mmitchel@gcc.gnu.org To: gcc-gnats@gcc.gnu.org Cc: Subject: c++/7584 Date: 17 Oct 2002 22:35:50 -0000 CVSROOT: /cvs/gcc Module name: gcc Changes by: mmitchel@gcc.gnu.org 2002-10-17 15:35:50 Modified files: gcc/cp : ChangeLog class.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/inherit: using3.C Log message: PR c++/7584 * class.c (handle_using_decl): Allow the declaration used to be from an ambiguous base. PR c++/7584 * g++.dg/inherit/using3.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3007&r2=1.3008 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/class.c.diff?cvsroot=gcc&r1=1.475&r2=1.476 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2155&r2=1.2156 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/inherit/using3.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
From: mmitchel@gcc.gnu.org To: gcc-gnats@gcc.gnu.org Cc: Subject: c++/7584 Date: 17 Oct 2002 22:37:49 -0000 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_2-branch Changes by: mmitchel@gcc.gnu.org 2002-10-17 15:37:49 Modified files: gcc/cp : ChangeLog class.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/inherit: using3.C Log message: PR c++/7584 * class.c (handle_using_decl): Allow the declaration used to be from an ambiguous base. PR c++/7584 * g++.dg/inherit/using3.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.2685.2.114.2.23&r2=1.2685.2.114.2.24 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/class.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.436.2.10.2.4&r2=1.436.2.10.2.5 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.1672.2.166.2.31&r2=1.1672.2.166.2.32 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/inherit/using3.C.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=NONE&r2=1.1.2.1