public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: benko@sztaki.hu
To: gcc-gnats@gcc.gnu.org
Subject: c++/6695: Regression: template friend declaration doesn't work
Date: Fri, 17 May 2002 06:16:00 -0000	[thread overview]
Message-ID: <20020517130606.5562.qmail@sources.redhat.com> (raw)


>Number:         6695
>Category:       c++
>Synopsis:       Regression: template friend declaration doesn't work
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 17 06:16:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Benko Pal
>Release:        3.1
>Organization:
>Environment:
SuSE 7.3, i686
>Description:
I want all instances of a class template
be friends of each other.
The syntax

template <typename T>
class a
{
  template <typename> friend class a;
};

works; it works even if this class is nested in
another class b.
But if this class b is itself a template, then I got an
error.  With 3.0.4 it worked.
>How-To-Repeat:
arta:~/c/proba$ g++3 templfriend2.cc
templfriend2.cc: In constructor `b<V>::a<T>::a(const b<V>::a<T*>&) [with T = 
   char, V = void*]':
templfriend2.cc:44:   instantiated from here
templfriend2.cc:12: `char*b<void*>::a<char*>::t_' is private
templfriend2.cc:29: within this context
zsh: exit 1     g++3 templfriend2.cc
arta:~/c/proba$ g++3 templfriend2.cc -DWORKS
arta:~/c/proba$ /gml/shared/gcc-3.0.4/bin/g++ templfriend2.cc
arta:~/c/proba$ g++3 -v
Reading specs from /gml/shared/gcc-3.1/lib/gcc-lib/i686-pc-linux-gnu/3.1/specs
Configured with: ../gcc-3.1/configure --prefix=/gml/shared/gcc-3.1 --enable-languages=c++ --with-dwarf2 --enable-threads=posix
Thread model: posix
gcc version 3.1
arta:~/c/proba$ /gml/shared/gcc-3.0.4/bin/g++ -v
Reading specs from /gml/shared/gcc-3.0.4/lib/gcc-lib/i686-pc-linux-gnu/3.0.4/specs
Configured with: ../gcc-3.0.4/configure --prefix=/gml/shared/gcc-3.0.4 --enable-threads=posix --enable-languages=c++
Thread model: posix
gcc version 3.0.4
arta:~/c/proba$ 
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="templfriend2.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="templfriend2.cc"

IyBpZm5kZWYgV09SS1MKdGVtcGxhdGUgPHR5cGVuYW1lIFY+CiMgZW5kaWYgLy8gV09SS1MKc3Ry
dWN0IGIKewogIHRlbXBsYXRlIDx0eXBlbmFtZSBUPgogIGNsYXNzIGEKICB7CiAgICB0ZW1wbGF0
ZSA8dHlwZW5hbWU+CiAgICBmcmllbmQgY2xhc3MgYTsKCiAgICBUIHRfOwoKICAgcHVibGljOgog
ICAgYSgpIHt9CiAgICBhKGE8VCAqPiBjb25zdCAmKTsKICB9Owp9OwoKIyBpZm5kZWYgV09SS1MK
dGVtcGxhdGUgPHR5cGVuYW1lIFY+CiMgZW5kaWYgLy8gV09SS1MKdGVtcGxhdGUgPHR5cGVuYW1l
IFQ+CmIKIyBpZm5kZWYgV09SS1MKPFY+CiMgZW5kaWYgLy8gV09SS1MKOjphPFQ+OjphKGE8VCAq
PiBjb25zdCAmcmhzKTogdF8oKnJocy50XykKe30KCgppbnQKbWFpbigpCnsKICBiCiMgaWZuZGVm
IFdPUktTCiAgICA8dm9pZCAqPgojIGVuZGlmIC8vIFdPUktTCiAgICA6OmE8Y2hhciAqPiBxOwog
IGIKIyBpZm5kZWYgV09SS1MKICAgIDx2b2lkICo+CiMgZW5kaWYgLy8gV09SS1MKICAgIDo6YTxj
aGFyPiB3KHEpOwoKICByZXR1cm4gMDsKfQo=


             reply	other threads:[~2002-05-17 13:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-17  6:16 benko [this message]
2002-06-05  7:04 lerdsuwa
2002-06-27 10:56 mmitchel
2002-06-27 14:50 mmitchel

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=20020517130606.5562.qmail@sources.redhat.com \
    --to=benko@sztaki.hu \
    --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).