re PR c++/59482 (A friend class cannot inherit a private nested class)

/cp
2014-01-22  Ville Voutilainen  <ville.voutilainen@gmail.com>

	PR c++/59482
	* parser.c (cp_parser_class_head): Push the class before parsing
	the base-clause, pop after it.

/testsuite
2014-01-22  Ville Voutilainen  <ville.voutilainen@gmail.com>

	PR c++/59482
	* g++.dg/pr59482.C: New.

From-SVN: r206933
This commit is contained in:
Ville Voutilainen 2014-01-22 20:08:01 +02:00 committed by Paolo Carlini
parent 1bb9990010
commit 32ab58b2a0
4 changed files with 29 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2014-01-22 Ville Voutilainen <ville.voutilainen@gmail.com>
PR c++/59482
* parser.c (cp_parser_class_head): Push the class before parsing
the base-clause, pop after it.
2014-01-20 Eric Botcazou <ebotcazou@adacore.com>
* decl2.c (cpp_check): Revert prototype change.

View File

@ -19845,7 +19845,17 @@ cp_parser_class_head (cp_parser* parser,
/* Get the list of base-classes, if there is one. */
if (cp_lexer_next_token_is (parser->lexer, CPP_COLON))
bases = cp_parser_base_clause (parser);
{
/* PR59482: enter the class scope so that base-specifiers are looked
up correctly */
if (type)
pushclass (type);
bases = cp_parser_base_clause (parser);
/* PR59482: get out of the previously pushed class scope so that the
subsequent pops pop the right thing */
if (type)
popclass ();
}
else
bases = NULL_TREE;

View File

@ -1,3 +1,8 @@
2014-01-22 Ville Voutilainen <ville.voutilainen@gmail.com>
PR c++/59482
* g++.dg/pr59482.C: New.
2014-01-22 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* gcc.dg/vmx/insert-vsx-be-order.c: New.

View File

@ -0,0 +1,7 @@
/* { dg-do compile } */
class aa {
friend class cc;
class bb {};
};
class cc : aa::bb {};