Message ID | CAFk2RUYwF_1y1Q78X5X0QpG04kEKD9AaL10C0EmYLf_Qp0F-5w@mail.gmail.com |
---|---|
State | New |
Headers | show |
On 2 February 2015 at 20:50, Ville Voutilainen <ville.voutilainen@gmail.com> wrote: > The modified test has been tested, I'm currently running the full testsuite, > so testing is incomplete. I wanted to send this in asap, since this is a > bad regression. > > /cp > 2015-02-02 Ville Voutilainen <ville.voutilainen@gmail.com> > > PR c++/64901 > * decl.c (duplicate_decls): Also duplicate DECL_FINAL_P and DECL_OVERRIDE_P. > > /testsuite > 2015-02-02 Ville Voutilainen <ville.voutilainen@gmail.com> > > PR c++/64901 > * g++.dg/cpp0x/override1.C: Add a test for the PR. For what it's worth, the complete testsuite passes without regressions, tested on Linux-x64.
Hi, On 02/02/2015 11:26 PM, Ville Voutilainen wrote: > On 2 February 2015 at 20:50, Ville Voutilainen > <ville.voutilainen@gmail.com> wrote: >> The modified test has been tested, I'm currently running the full testsuite, >> so testing is incomplete. I wanted to send this in asap, since this is a >> bad regression. >> >> /cp >> 2015-02-02 Ville Voutilainen <ville.voutilainen@gmail.com> >> >> PR c++/64901 >> * decl.c (duplicate_decls): Also duplicate DECL_FINAL_P and DECL_OVERRIDE_P. >> >> /testsuite >> 2015-02-02 Ville Voutilainen <ville.voutilainen@gmail.com> >> >> PR c++/64901 >> * g++.dg/cpp0x/override1.C: Add a test for the PR. > For what it's worth, the complete testsuite passes without > regressions, tested on Linux-x64. I see that Jason applied the fix to mainline. Today I noticed that this is also a regression in the 4_9-branch: shall I regression test the fix there too, in case apply and close the bug? Thanks! Paolo.
On 4 February 2015 at 12:22, Paolo Carlini <paolo.carlini@oracle.com> wrote: > I see that Jason applied the fix to mainline. Today I noticed that this is > also a regression in the 4_9-branch: shall I regression test the fix there > too, in case apply and close the bug? Please do, thanks.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 4527e3f..d77a0a8 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -1813,6 +1813,8 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend) DECL_PURE_VIRTUAL_P (newdecl) |= DECL_PURE_VIRTUAL_P (olddecl); DECL_VIRTUAL_P (newdecl) |= DECL_VIRTUAL_P (olddecl); DECL_INVALID_OVERRIDER_P (newdecl) |= DECL_INVALID_OVERRIDER_P (olddecl); + DECL_FINAL_P (newdecl) |= DECL_FINAL_P (olddecl); + DECL_OVERRIDE_P (newdecl) |= DECL_OVERRIDE_P (olddecl); DECL_THIS_STATIC (newdecl) |= DECL_THIS_STATIC (olddecl); if (DECL_OVERLOADED_OPERATOR_P (olddecl) != ERROR_MARK) SET_OVERLOADED_OPERATOR_CODE diff --git a/gcc/testsuite/g++.dg/cpp0x/override1.C b/gcc/testsuite/g++.dg/cpp0x/override1.C index 05d7290..7686a28 100644 --- a/gcc/testsuite/g++.dg/cpp0x/override1.C +++ b/gcc/testsuite/g++.dg/cpp0x/override1.C @@ -4,8 +4,11 @@ struct B virtual void f() final {} virtual void g() {} virtual void x() const {} + virtual void y() final; }; +void B::y() {} // { dg-error "overriding" } + struct B2 { virtual void h() {} @@ -14,6 +17,7 @@ struct B2 struct D : B { virtual void g() override final {} // { dg-error "overriding" } + virtual void y() override final {} // { dg-error "virtual" } }; template <class T> struct D2 : T