Message ID | 87fw9vxfr6.wl%ville@ville-laptop |
---|---|
State | New |
Headers | show |
Applied, thanks. Note that your dg-error regexp doesn't make much sense: // { dg-error "expected type-specifier before 'final'||expected ';'||declaration doesn't declare anything" } Regular expression "or" uses a single |, so this ends up being a long way of writing // { dg-error "" } I adjusted the dg-error lines to check only for the "expected type-specifier" error, and used dg-prune-output to discard the extra errors. Jason
On 20 June 2012 10:35, Jason Merrill <jason@redhat.com> wrote: > Applied, thanks. Note that your dg-error regexp doesn't make much sense: > > > // { dg-error "expected type-specifier before 'final'||expected > ';'||declaration doesn't declare anything" } > > Regular expression "or" uses a single |, so this ends up being a long way of > writing > > // { dg-error "" } Funny. The testcasewriting gcc wiki page at http://gcc.gnu.org/wiki/TestCaseWriting suggests a double pipe. Quoth the Raven: Should a line produce two errors, the regular expression should include an "||" (ie. a regular expression OR) between the possible message fragments. If a single pipe is indeed to be used, perhaps we want to correct that piece of documentation, lest fools follow its advice. :)
On 06/20/2012 12:57 AM, Ville Voutilainen wrote: > If a single pipe is indeed to be used, perhaps we want to correct that > piece of documentation, lest fools follow its advice. :) Done, thanks. Jason
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 1691f81..6bc6877 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -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,