public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: gdr@codesourcery.com
To: gcc-gnats@gcc.gnu.org
Subject: c++/4003: ICE on template instantiation including friendship declaration.
Date: Sat, 11 Aug 2001 03:46:00 -0000	[thread overview]
Message-ID: <20010811103635.1628.qmail@sourceware.cygnus.com> (raw)

>Number:         4003
>Category:       c++
>Synopsis:       ICE on template instantiation including friendship declaration.
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Sat Aug 11 03:46:05 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Gabriel Dos Reis (gdr@codesourcery.com)
>Release:        GCC-3.0.1 and GCC-3.1
>Organization:
>Environment:
Immaterial
>Description:
The below produces an ICE.  A regression over gcc-2.95.x
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="sm.C"
Content-Disposition: inline; filename="sm.C"

template<typename> class BinaryTree;

template<typename T>
void move(BinaryTree<T>&, typename BinaryTree<T>::iterator,
          BinaryTree<T>&, typename BinaryTree<T>::iterator);

template<class T>
class BinaryTree {
public:
  class iterator {
  private:
    int i;
    friend void move<T>(BinaryTree<T> &t1,iterator n1,
                       BinaryTree<T> &t2,iterator n2);
  };
};


template<class T>
inline void move(BinaryTree<T> &t1, typename BinaryTree<T>::iterator n1,
                 BinaryTree<T> &t2, typename BinaryTree<T>::iterator n2)
{
  int x = n1.i + n2.i;    // this is the line that uses the friendship
}

int main() {
  typedef BinaryTree<int> BT;
  BT t;
  BT::iterator n;
  move(t, n, t, n);
}


             reply	other threads:[~2001-08-11  3:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-11  3:46 gdr [this message]
2002-02-26 12:01 nathan
2002-03-18  3:54 jason
2002-03-18  5:49 jason

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=20010811103635.1628.qmail@sourceware.cygnus.com \
    --to=gdr@codesourcery.com \
    --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).