This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/9030: [3.4 regression] Template friends and access to local classes
- From: bangerth at ticam dot utexas dot edu
- To: gcc-gnats at gcc dot gnu dot org
- Date: 20 Dec 2002 20:25:09 -0000
- Subject: c++/9030: [3.4 regression] Template friends and access to local classes
- Reply-to: bangerth at ticam dot utexas dot edu
>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: