This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

c++/511: public enums in class template not accessible via specialized subclass



>Number:         511
>Category:       c++
>Synopsis:       public enums in class template not accessible via specialized subclass
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 06 07:06:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Malte Starostik
>Release:        gcc version 2.96 20000724 (experimental)
>Organization:
>Environment:
Distribution: RedHat 6.9.5 (Pinstripe)
glibc: 2.1.92
>Description:
Public enum types of a class template are not accessible in specialized subclasses (hope I got the terminology right, sorry otherwise).
Thank you,
-Malte

The code in "How-To-Repeat" produces the following error message:

 g++ -v --save-temps -o boom boom.cpp
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000724 (experimental)
 /usr/lib/gcc-lib/i386-redhat-linux/2.96/cpp -lang-c++ -D__GNUG__=2 -v -D__GNUC_
_=2 -D__GNUC_MINOR__=96 -D__GNUC_PATCHLEVEL__=0 -D__ELF__ -Dunix -Dlinux -D__ELF
__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem(posix) -Acpu(i386) -Amachi
ne(i386) -Di386 -D__i386 -D__i386__ -D__tune_i386__ boom.cpp boom.ii
GNU CPP version 2.96 20000724 (experimental) (cpplib)
 (i386 Linux/ELF)
ignoring nonexistent directory "/usr/i386-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include
End of search list.
 /usr/lib/gcc-lib/i386-redhat-linux/2.96/cc1plus boom.ii -quiet -dumpbase boom.cpp -version -o boom.s
GNU C++ version 2.96 20000724 (experimental) (i386-redhat-linux) compiled by GNU C version 2.96 20000724 (experimental).
boom.cpp: In method `void C::choke (A<B>::foo)':
boom.cpp:11: `enum A<B>::foo' is private
boom.cpp:13: within this context
>How-To-Repeat:
# 1 "boom.cpp"
 
template <class T>
class A {
public:
  enum foo {bar=0, baz=1};
};
 
class B {
};
 
class C: public A<B> {
public:
  void choke(foo) {};
};
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]