This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/28142] New: Template friend declaration and dependent names
- From: "wolfgang dot roehrl at gi-de dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Jun 2006 11:02:27 -0000
- Subject: [Bug c++/28142] New: Template friend declaration and dependent names
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Dear all,
I would like to post a bug report for the GNU C/C++ compiler 3.3-e500.
We use the compiler to generate code for a PowerPC processor.
Used invokation line for the GNU C++ compiler:
ccppc -c -x c++ -ansi -Wall -Werror -mcpu=8540 -fverbose-asm -mbig
-fmerge-templates -mmultiple -mno-string -mstrict-align -O3
-fno-exceptions -fno-rtti -fno-builtin-printf
-I<some include paths>
-D<some #define's>
X.CPP -oX.O
// file X.CPP
template <typename T_>
struct S
{
struct B;
};
class C
{
template <typename T_>
friend struct S<T_>::B; // <--- line 10
};
The compiler gives the following error message:
X.CPP:10: warning: `S<T_>::B' is implicitly a typename
X.CPP:10: warning: implicit typename is deprecated, please see the
documentation for details
X.CPP:10: error: typename type `S<T_>::B' declared `friend'
According to 14.5.3/6 the compiler should accept the code above.
Kind regards
W. Roehrl
--
Summary: Template friend declaration and dependent names
Product: gcc
Version: 3.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: wolfgang dot roehrl at gi-de dot com
GCC build triplet: sparc-sun-solaris2.5.1
GCC host triplet: i386-pc-mingw32
GCC target triplet: powerpc-wrs-vxworks
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28142