This is the mail archive of the gcc-prs@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]
Other format: [Raw text]

c++/9937: Failure to lookup base class name when base is template specialization


>Number:         9937
>Category:       c++
>Synopsis:       Failure to lookup base class name when base is template specialization
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Tue Mar 04 12:26:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Thomas Witt
>Release:        3.2.2
>Organization:
>Environment:
Linux 2.4.18 ix86 glibc 2.2.5
Suse 8.0
Reading specs from /opt/gcc-3.2.2/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/specs
Configured with: ../gcc-3.2.2/configure --enable-threads=posix --enable-long-long --prefix=/opt/gcc-3.2.2 --disable-nls --enable-shared --enable-languages=c,c++ --enable-__cxa_atexit
Thread model: posix
gcc version 3.2.2
>Description:
$ gcc --save-temps namespace.cpp
namespace.cpp:23: error: syntax error before `*' token
namespace.cpp:28: error: syntax error before `*' token

B* and B<int>* aren't found. They should be found in the same way as
A is found in gunc::X definition.

IIUC the following paragraphs from the std apply.

9/2
3.4/3
10.2/2
14.2/6
14.6.1/2a

They basically say that the name of a base class is in the scope of the derived class. I.e. you can
refer to it using an unqualified-id no matter in what namespace the base class name is declared.

I can provide full-text citations if needed.
>How-To-Repeat:
# 1 "namespace.cpp"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "namespace.cpp"

namespace hunc
{
  struct A {};

  template <class T>
  struct B
  {
  };
}

namespace gunc
{
  typedef hunc::B<int> Ybase;

  struct X : hunc::A
  {
    A* a;
  };

  struct Y : hunc::B<int>
  {
   B<int>* b;
  };

  struct Z : hunc::B<int>
  {
    B* c;
  };
}

int main()
{
}
>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]