re PR c++/4100 ([parser] friend qualifier accepted in definition of nested class)

PR c++/4100
	* g++.dg/parse/friend4.C: New test.
	* g++.old-deja/g++.pt/niklas01a.C: Mark an error where a class
	definition is called a friend.

From-SVN: r75727
This commit is contained in:
Ian Lance Taylor 2004-01-12 16:15:19 +00:00
parent 0426c4ca86
commit 59147a629a
3 changed files with 20 additions and 1 deletions

View File

@ -1,3 +1,14 @@
2004-01-12 Ian Lance Taylor <ian@wasabisystems.com>
PR c++/4100
* g++.dg/parse/friend4.C: New test.
2004-01-12 Scott Brumbaugh <scottb.lists@verizon.net>
PR c++/4100
* g++.old-deja/g++.pt/niklas01a.C: Mark an error where a class
definition is called a friend.
2004-01-11 Zack Weinberg <zack@codesourcery.com>
* gcc.dg/tls/diag-3.c: Tweak dg-error regexp.

View File

@ -0,0 +1,8 @@
// { dg-do compile }
// PR c++/4100
// You can't use friend when defining a class.
class A {
friend class B { }; // { dg-error "friend" }
};

View File

@ -3,6 +3,6 @@
struct A { // { dg-error "" } forward declaration
friend struct B : A { // { dg-error "" }
int x;
};
}; // { dg-error "" } class definition cannot be a friend
int y;
};