Alternate function syntax parsing improvement
This was incorrectly accepting qualifiers and exception specifications in the wrong place.
This commit is contained in:
parent
8227c02267
commit
0e50ef30b1
1 changed files with 10 additions and 2 deletions
|
|
@ -1629,7 +1629,7 @@ static String *add_qualifier_to_declarator(SwigType *type, SwigType *qualifier)
|
|||
%type <node> lambda_introducer lambda_body;
|
||||
%type <pl> lambda_tail;
|
||||
%type <node> optional_constant_directive;
|
||||
%type <str> virt_specifier_seq;
|
||||
%type <str> virt_specifier_seq virt_specifier_seq_opt;
|
||||
|
||||
%%
|
||||
|
||||
|
|
@ -3166,7 +3166,7 @@ c_decl : storage_class type declarator cpp_const initializer c_decl_tail {
|
|||
}
|
||||
/* Alternate function syntax introduced in C++11:
|
||||
auto funcName(int x, int y) -> int; */
|
||||
| storage_class AUTO declarator cpp_const ARROW cpp_alternate_rettype cpp_const initializer c_decl_tail {
|
||||
| storage_class AUTO declarator cpp_const ARROW cpp_alternate_rettype virt_specifier_seq_opt initializer c_decl_tail {
|
||||
$$ = new_node("cdecl");
|
||||
if ($4.qualifier) SwigType_push($3.type, $4.qualifier);
|
||||
Setattr($$,"refqualifier",$4.refqualifier);
|
||||
|
|
@ -6627,6 +6627,14 @@ virt_specifier_seq : OVERRIDE {
|
|||
}
|
||||
;
|
||||
|
||||
virt_specifier_seq_opt : virt_specifier_seq {
|
||||
$$ = 0;
|
||||
}
|
||||
| empty {
|
||||
$$ = 0;
|
||||
}
|
||||
;
|
||||
|
||||
exception_specification : THROW LPAREN parms RPAREN {
|
||||
$$.throws = $3;
|
||||
$$.throwf = NewString("1");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue