public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: witt@ive.uni-hannover.de
To: gcc-gnats@gcc.gnu.org
Subject: c++/9937: Failure to lookup base class name when base is template specialization
Date: Tue, 04 Mar 2003 12:26:00 -0000	[thread overview]
Message-ID: <20030304122052.22996.qmail@sources.redhat.com> (raw)


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


             reply	other threads:[~2003-03-04 12:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-04 12:26 witt [this message]
2003-03-04 15:45 bangerth
2003-03-04 16:16 Thomas Witt
2003-03-04 16:26 Wolfgang Bangerth
2003-03-05 15:26 Wolfgang Bangerth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030304122052.22996.qmail@sources.redhat.com \
    --to=witt@ive.uni-hannover.de \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).