Commit 32ab58b2 by Ville Voutilainen Committed by Paolo Carlini

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
parent 1bb99900
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> 2014-01-20 Eric Botcazou <ebotcazou@adacore.com>
* decl2.c (cpp_check): Revert prototype change. * decl2.c (cpp_check): Revert prototype change.
......
...@@ -19845,7 +19845,17 @@ cp_parser_class_head (cp_parser* parser, ...@@ -19845,7 +19845,17 @@ cp_parser_class_head (cp_parser* parser,
/* Get the list of base-classes, if there is one. */ /* Get the list of base-classes, if there is one. */
if (cp_lexer_next_token_is (parser->lexer, CPP_COLON)) 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 else
bases = NULL_TREE; bases = NULL_TREE;
......
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> 2014-01-22 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* gcc.dg/vmx/insert-vsx-be-order.c: New. * gcc.dg/vmx/insert-vsx-be-order.c: New.
......
/* { dg-do compile } */
class aa {
friend class cc;
class bb {};
};
class cc : aa::bb {};
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