This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/9190: [3.4 regression] Access control looks for names the wrong way
- From: bangerth at ticam dot utexas dot edu
- To: gcc-gnats at gcc dot gnu dot org
- Date: 6 Jan 2003 15:36:06 -0000
- Subject: c++/9190: [3.4 regression] Access control looks for names the wrong way
- Reply-to: bangerth at ticam dot utexas dot edu
>Number: 9190
>Category: c++
>Synopsis: [3.4 regression] Access control looks for names the wrong way
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Jan 06 07:46:02 PST 2003
>Closed-Date:
>Last-Modified:
>Originator: Wolfgang Bangerth
>Release: unknown-1.0
>Organization:
>Environment:
Present CVS
>Description:
This file
---------------------------
template <int N> class B {
protected:
struct Inner {
static int f();
};
};
template <int N> class D : public B<N> {
void f() { B<N>::Inner::f(); };
};
-----------------------------used to compile, but now yields
tmp/g> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -o /dev/null -c bug3.cc
bug3.cc: In member function `void D<N>::f()':
bug3.cc:3: error: `struct B<N>::Inner' is protected
bug3.cc:9: error: within this context
I think this is wrong, since name lookup of B<N>::Inner
should happen from within the inheritance hierarchy, not
go outside.
The bug is kind of fragile: if I remove any template args,
or make Inner::f a static variable instead of a function,
then everything compiles fine. This is strange...
Regards
Wolfgang
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: