Commit b46ce77f by Simon Martin Committed by Simon Martin

re PR c++/32111 (ICE declaring destructor as friend)

gcc/cp/

2007-06-26  Simon Martin  <simartin@users.sourceforge.net>
        
	PR c++/32111
	* decl.c (grokdeclarator): Reset friendp for member functions declared
	friend of their own class.

gcc/testsuite/

2006-06-26  Simon Martin  <simartin@users.sourceforge.net>

	PR c++/32111
	* g++.dg/other/friend5.C: New test.

From-SVN: r126006
parent aacfb86b
2007-06-26 Simon Martin <simartin@users.sourceforge.net>
PR c++/32111
* decl.c (grokdeclarator): Reset friendp for member functions declared
friend of their own class.
2007-06-23 Mark Mitchell <mark@codesourcery.com>
* decl2.c (determine_visibility): Don't look for dllexport here.
......
......@@ -8057,7 +8057,10 @@ grokdeclarator (const cp_declarator *declarator,
if (ctype == current_class_type)
{
if (friendp)
pedwarn ("member functions are implicitly friends of their class");
{
pedwarn ("member functions are implicitly friends of their class");
friendp = 0;
}
else
pedwarn ("extra qualification %<%T::%> on member %qs",
ctype, name);
......
2006-06-26 Simon Martin <simartin@users.sourceforge.net>
PR c++/32111
* g++.dg/other/friend5.C: New test.
2007-06-25 Paul Thomas <pault@gcc.gnu.org>
PR fortran/32464
/* PR c++/32111 */
/* This used to ICE. */
/* { dg-do "compile" } */
struct A
{
friend A::~A() {} /* { dg-error "implicitly friends of their class" } */
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment