public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: bangerth@ticam.utexas.edu
To: gcc-gnats@gcc.gnu.org
Subject: c++/9030: [3.4 regression] Template friends and access to local classes
Date: Fri, 20 Dec 2002 12:26:00 -0000	[thread overview]
Message-ID: <20021220202509.24370.qmail@sources.redhat.com> (raw)


>Number:         9030
>Category:       c++
>Synopsis:       [3.4 regression] Template friends and access to local classes
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Dec 20 12:26:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Wolfgang Bangerth
>Release:        unknown-1.0
>Organization:
>Environment:
Today's CVS.
>Description:
The following used to compile (and does so with icc7, for
example, in strict ANSI conformance mode):
---------------------------
template <class T> class Outer {
  private:
    struct Inner {};

    template <class T_>
    friend typename Outer<T_>::Inner foo ();
};

template <class T>
typename Outer<T>::Inner
foo () {
  return Outer<T>::Inner();
}

void f() {
  foo<int>();
}
-----------------------------

It fails since yesterday:
tmp/g> /home/bangerth/bin/gcc-3.4-CVS/bin/c++ -c x.cc
x.cc: In function `void f()':
x.cc:3: error: `struct Outer<int>::Inner' is private
x.cc:16: error: within this context
x.cc:3: error: `struct Outer<int>::Inner' is private
x.cc:16: error: within this context
x.cc:3: error: `struct Outer<int>::Inner' is private
x.cc:11: error: within this context
x.cc: At global scope:
x.cc: In instantiation of `typename Outer<T>::Inner foo() [with T = int]':
x.cc:16:   instantiated from here
x.cc:3: error: `struct Outer<int>::Inner' is private
x.cc:11: error: within this context
x.cc:3: error: `struct Outer<int>::Inner' is private
x.cc:11: error: within this context

Kriang, I think that one of your patches yesterday must
have caused this, since our nightly builds went fine
until this night. Could you take a look at it?

Thanks
  Wolfgang
>How-To-Repeat:

>Fix:

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


             reply	other threads:[~2002-12-20 20:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-20 12:26 bangerth [this message]
2002-12-21  1:23 lerdsuwa
2002-12-23 21:56 Kriang Lerdsuwanakij

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=20021220202509.24370.qmail@sources.redhat.com \
    --to=bangerth@ticam.utexas.edu \
    --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).