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
This commit is contained in:
parent
aacfb86b57
commit
b46ce77fe8
4 changed files with 24 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
|||
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);
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
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
|
||||
|
|
9
gcc/testsuite/g++.dg/other/friend5.C
Normal file
9
gcc/testsuite/g++.dg/other/friend5.C
Normal file
|
@ -0,0 +1,9 @@
|
|||
/* PR c++/32111 */
|
||||
/* This used to ICE. */
|
||||
|
||||
/* { dg-do "compile" } */
|
||||
|
||||
struct A
|
||||
{
|
||||
friend A::~A() {} /* { dg-error "implicitly friends of their class" } */
|
||||
};
|
Loading…
Add table
Reference in a new issue