Commit 59147a62 by Ian Lance Taylor

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
parent 0426c4ca
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> 2004-01-11 Zack Weinberg <zack@codesourcery.com>
* gcc.dg/tls/diag-3.c: Tweak dg-error regexp. * gcc.dg/tls/diag-3.c: Tweak dg-error regexp.
......
// { dg-do compile }
// PR c++/4100
// You can't use friend when defining a class.
class A {
friend class B { }; // { dg-error "friend" }
};
...@@ -3,6 +3,6 @@ ...@@ -3,6 +3,6 @@
struct A { // { dg-error "" } forward declaration struct A { // { dg-error "" } forward declaration
friend struct B : A { // { dg-error "" } friend struct B : A { // { dg-error "" }
int x; int x;
}; }; // { dg-error "" } class definition cannot be a friend
int y; int y;
}; };
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