parser.c (cp_parser_direct_declarator): Move virt-specifier parsing after late-specified return type parsing.
* parser.c (cp_parser_direct_declarator): Move virt-specifier parsing after late-specified return type parsing. From-SVN: r188808
This commit is contained in:
parent
420bf978a7
commit
6830e502a2
@ -1,3 +1,8 @@
|
||||
2012-06-16 Ville Voutilainen <ville.voutilainen@gmail.com>
|
||||
|
||||
* parser.c (cp_parser_direct_declarator): Move virt-specifier
|
||||
parsing after late-specified return type parsing.
|
||||
|
||||
2012-06-14 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/53651
|
||||
|
@ -16102,12 +16102,13 @@ cp_parser_direct_declarator (cp_parser* parser,
|
||||
/* And the exception-specification. */
|
||||
exception_specification
|
||||
= cp_parser_exception_specification_opt (parser);
|
||||
/* Parse the virt-specifier-seq. */
|
||||
virt_specifiers = cp_parser_virt_specifier_seq_opt (parser);
|
||||
|
||||
late_return = (cp_parser_late_return_type_opt
|
||||
(parser, member_p ? cv_quals : -1));
|
||||
|
||||
/* Parse the virt-specifier-seq. */
|
||||
virt_specifiers = cp_parser_virt_specifier_seq_opt (parser);
|
||||
|
||||
/* Create the function-declarator. */
|
||||
declarator = make_call_declarator (declarator,
|
||||
params,
|
||||
|
@ -1,3 +1,7 @@
|
||||
2012-06-16 Ville Voutilainen <ville.voutilainen@gmail.com>
|
||||
|
||||
* g++.dg/cpp0x/override4.C: New.
|
||||
|
||||
2012-06-14 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/53651
|
||||
|
45
gcc/testsuite/g++.dg/cpp0x/override4.C
Normal file
45
gcc/testsuite/g++.dg/cpp0x/override4.C
Normal file
@ -0,0 +1,45 @@
|
||||
// { dg-options "-std=c++11" }
|
||||
// { dg-prune-output "expected ';'" }
|
||||
// { dg-prune-output "expected unqualified-id" }
|
||||
// { dg-prune-output "declaration does not declare anything" }
|
||||
|
||||
struct B
|
||||
{
|
||||
virtual auto f() -> void final;
|
||||
virtual auto g() -> void;
|
||||
};
|
||||
|
||||
struct B2
|
||||
{
|
||||
virtual auto f() -> void final {}
|
||||
};
|
||||
|
||||
struct B3
|
||||
{
|
||||
virtual auto f() -> final void; // { dg-error "expected type-specifier" }
|
||||
};
|
||||
|
||||
struct B4
|
||||
{
|
||||
virtual auto f() -> final void {} // { dg-error "expected type-specifier" }
|
||||
};
|
||||
|
||||
struct D : B
|
||||
{
|
||||
virtual auto g() -> void override;
|
||||
};
|
||||
|
||||
struct D2 : B
|
||||
{
|
||||
virtual auto g() -> void override {}
|
||||
};
|
||||
|
||||
struct D3 : B
|
||||
{
|
||||
virtual auto g() -> override void; // { dg-error "expected type-specifier" }
|
||||
};
|
||||
|
||||
struct D4 : B
|
||||
{
|
||||
virtual auto g() -> override void {} // { dg-error "expected type-specifier" }
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user