Commit b9af306b by Ville Voutilainen Committed by Jason Merrill

re PR c++/50811 ([C++0x] G++ rejects class-virt-specifier if class-head-name…

re PR c++/50811 ([C++0x] G++ rejects class-virt-specifier if class-head-name includes nested-name-specifier)

	PR c++/50811
	* parser.c (cp_parser_class_head): Parse virt-specifiers
	regardless of whether an id is present

From-SVN: r180301
parent d75b2721
2011-10-21 Ville Voutilainen <ville.voutilainen@gmail.com>
PR c++/50811
* parser.c (cp_parser_class_head): Parse virt-specifiers
regardless of whether an id is present
2011-10-20 Jason Merrill <jason@redhat.com>
PR c++/41449
......
......@@ -17853,8 +17853,8 @@ cp_parser_class_head (cp_parser* parser,
{
cp_parser_check_for_invalid_template_id (parser, id,
type_start_token->location);
virt_specifiers = cp_parser_virt_specifier_seq_opt (parser);
}
virt_specifiers = cp_parser_virt_specifier_seq_opt (parser);
/* If it's not a `:' or a `{' then we can't really be looking at a
class-head, since a class-head only appears as part of a
......
2011-10-21 Ville Voutilainen <ville.voutilainen@gmail.com>
PR c++/50811
* g++.dg/cpp0x/override2.C: Add test.
2011-10-21 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* lib/gcc-dg.exp (GCC_UNDER_TEST): Set before calling
......
......@@ -28,6 +28,13 @@ struct B6 final final {}; // { dg-error "duplicate virt-specifier" }
struct B7 override {}; // { dg-error "cannot specify 'override' for a class" }
namespace N
{
struct C;
}
struct N::C final{};
int main()
{
D3<B1> d;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment