public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/9190: [3.4 regression] Access control looks for names the wrong way
@ 2003-01-06 15:46 bangerth
  0 siblings, 0 replies; only message in thread
From: bangerth @ 2003-01-06 15:46 UTC (permalink / raw)
  To: gcc-gnats


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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-01-06 15:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-06 15:46 c++/9190: [3.4 regression] Access control looks for names the wrong way bangerth

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).