Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parser fails with "throw(...)" exception specification #892

Closed
Bertk opened this issue Jun 20, 2016 · 5 comments · Fixed by #894
Closed

parser fails with "throw(...)" exception specification #892

Bertk opened this issue Jun 20, 2016 · 5 comments · Fixed by #894
Assignees
Milestone

Comments

@Bertk
Copy link
Contributor

Bertk commented Jun 20, 2016

The parser fails with exception specification like

int myfunc() throw(...){}

Without "..." everything is fine

int myfunc1() throw(){
}
int myfunc2() throw(int){
}

see also https://msdn.microsoft.com/en-us/library/wfa0edys.aspx

@Bertk Bertk added the bug label Jun 20, 2016
@guwirth
Copy link
Collaborator

guwirth commented Jun 21, 2016

Seems to be a Microsoft specific extension?

@Bertk
Copy link
Contributor Author

Bertk commented Jun 21, 2016

Yes, this is "Nonstandard Behavior" (see also https://msdn.microsoft.com/en-us/library/x84h5b78.aspx)

@Bertk
Copy link
Contributor Author

Bertk commented Jun 21, 2016

This modification will solve the issue

    b.rule(typeIdList).is(
      b.firstOf(
        b.sequence(typeId, b.optional("..."), b.zeroOrMore(",", typeId, b.optional("..."))), // C++ 
        "..."// Microsoft extension
      )
    ); 

@guwirth
Copy link
Collaborator

guwirth commented Jun 22, 2016

Would do it like this, think "..." is not a typeIdList?

b.rule(dynamicExceptionSpecification).is(
   CxxKeyword.THROW, "(", b.optional(b.firstOf(
      typeIdList, // C++
      "..." // Microsoft extension
    )), ")"
);

@guwirth guwirth added enhancement and removed bug labels Jun 22, 2016
@Bertk
Copy link
Contributor Author

Bertk commented Jun 23, 2016

Actually I am not sure whether "..." is not a synonym for any type in this context.
see also http://en.cppreference.com/w/cpp/language/try_catch

The catch-all clause catch(...) matched exceptions of any type.

The Exception Specifications (throw) (C++) documentation on MSDN uses ... instead typeIdList

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants