Message ID | CAFk2RUbqm4X5o9K95JZWHYMWiExtuVRCXvKjbreWf86jw4=2YQ@mail.gmail.com |
---|---|
State | New |
Headers | show |
OK, thanks. Jason
On 01/21/2014 04:24 PM, Jason Merrill wrote:
> OK, thanks.
I don't think Ville has Write After Approval, thus I'm going to commit
this on his behalf.
Thanks,
Paolo.
On 22 January 2014 19:39, Paolo Carlini <paolo.carlini@oracle.com> wrote: > On 01/21/2014 04:24 PM, Jason Merrill wrote: >> >> OK, thanks. > > I don't think Ville has Write After Approval, thus I'm going to commit this > on his behalf. Oh, I was expecting Jason would do that. Note that Marek Polacek pointed out two formatting issues: - comments should have full stop and two spaces at the end - also two spaces before <e-mail> in the ChangeLog
Hi, On 01/22/2014 11:38 PM, Ville Voutilainen wrote: > Oh, I was expecting Jason would do that. Note that Marek Polacek pointed > out two formatting issues: > - comments should have full stop and two spaces at the end Yes, will fix in my next commit touching that file. > - also two spaces before <e-mail> in the ChangeLog I took care of this when I applied the patch. Thanks, Paolo.
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/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 {};