PR c++/64901
* decl.c (duplicate_decls): Also duplicate DECL_FINAL_P and
DECL_OVERRIDE_P.
From-SVN: r220363
+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.
+
2015-02-02 Jason Merrill <jason@redhat.com>
* tree.c (handle_abi_tag_attribute): Diagnose invalid arguments.
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
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() {}
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