Re: Problem with templates and friends on g++ 3.4.2
"Earnie Boyd" <[email protected]> Mon, 28 Mar 2005 14:53:39 -0500 (EST)
| Newsgroups | gmane.comp.gnu.mingw.patches |
|---|---|
| Message-ID | <[email protected]> |
This list is to be used to discuss patches submitted. Not problems that require a patch to be created. Please keep your posts to mingw-users-TtF/[email protected] unless you wish to discuss a patch that has been submitted. Earnie <quote who=3D"Angel Tsankov"> > I've just installed WinGW 3.2.0 RC 3 (g++ -v returns 3.4.2) and got an > error > compiling the following piece of c++ code: > > template< typename t > > class t2 > { > friend t; // error: a class-key must be used when declaring a frien= d > }; > > Then I tried to compile this code: > > template< typename t > > class t2 > { > friend typename t; // this is main.cpp:6 > }; > > and got this: > > main.cpp:6: error: expected nested-name-specifier before "t" > main.cpp:6: error: ISO C++ forbids declaration of `t' with no type > main.cpp:6: error: `t' is neither function nor member function; cannot = be > declared friend > > I think the second piece of code is perfectly legal and should compile = (at > least it was reported to compile on gcc 3.4.3). > > Should I upgrade to 3.4.3 (and if so, how?) or is there any workaround = for > the issue? > > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users= . > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick > _______________________________________________ > MinGW-patches mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/mingw-patches > Earnie -- MinGW - http://www.mingw.org/ Wiki - http://www.mingw.org/MinGWiki/ SF Project - http://sourceforge.net/projects/mingw Job Listing - http://sf.net/people/viewjob.php?group_id=3D2435&job_id=3D2= 1643 ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick