Implement final/override for member functions.
authorVille Voutilainen <ville.voutilainen@gmail.com>
Mon, 9 May 2011 17:34:35 +0000 (20:34 +0300)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 9 May 2011 17:34:35 +0000 (13:34 -0400)
commitb5da71d41644c40db95aabac8f67c28294f4c85f
tree704c11fb901ce576ac515237bef43408fce32e9c
parent51e7f3770c99afc09afc9e9837aad4c8505fbbf8
Implement final/override for member functions.

gcc/
* tree.h (TYPE_UNQUALIFIED, TYPE_QUAL_CONST): Convert to enum.
(TYPE_QUAL_VOLATILE, TYPE_QUAL_RESTRICT): Likewise.
gcc/cp/
* class.c (check_for_override): Check for DECL_OVERRIDE_P.
* cp-tree.h (DECL_OVERRIDE_P, DECL_FINAL_P): New.
(cp_virt_specifiers, enum virt_specifier): New.
* decl.c (set_virt_specifiers): New.
(grokdeclarator): Use them. Diagnose virt-specifiers on non-fields.
* parser.c (make_call_declarator): add virt-specifiers parameter.
(cp_parser_lambda_declarator_opt): Adjust.
(cp_parser_direct_declarator): Likewise.
(cp_parser_virt_specifier_seq_opt): New.
* search.c (check_final_overrider): Diagnose attempts to override
a final member function.

From-SVN: r173581
gcc/ChangeLog
gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/parser.c
gcc/cp/search.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/inherit/virtual9.C [new file with mode: 0644]
gcc/tree.h