diff options
author | Ville Voutilainen <ville.voutilainen@gmail.com> | 2014-01-22 20:08:01 +0200 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2014-01-22 18:08:01 +0000 |
commit | 32ab58b2a067db7571934d55fc1aaed80d23f5b3 (patch) | |
tree | c4428bd731d30db9d4d54e5a992b3916fc717c55 | |
parent | 1bb999001008c6caf64e8190828df31dc32286fa (diff) | |
download | gcc-32ab58b2a067db7571934d55fc1aaed80d23f5b3.zip gcc-32ab58b2a067db7571934d55fc1aaed80d23f5b3.tar.gz gcc-32ab58b2a067db7571934d55fc1aaed80d23f5b3.tar.bz2 |
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
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/parser.c | 12 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/pr59482.C | 7 |
4 files changed, 29 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 0b9c181..671b36c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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. diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index c3016bc..3bc943b 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -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; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 447d3c7..243a760 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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. diff --git a/gcc/testsuite/g++.dg/pr59482.C b/gcc/testsuite/g++.dg/pr59482.C new file mode 100644 index 0000000..bde8329 --- /dev/null +++ b/gcc/testsuite/g++.dg/pr59482.C @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +class aa { + friend class cc; + class bb {}; +}; + +class cc : aa::bb {}; |