Skip to content

9955: Fix ast when throwing a cast#2900

Merged
danmar merged 1 commit into
cppcheck-opensource:mainfrom
Ken-Patrick:9955
Nov 15, 2020
Merged

9955: Fix ast when throwing a cast#2900
danmar merged 1 commit into
cppcheck-opensource:mainfrom
Ken-Patrick:9955

Conversation

@Ken-Patrick

Copy link
Copy Markdown
Contributor
throw (std::string)"Error: " + strerror(errnum);

would result in a broken ast:

throw
`-::
  |-std
  `-string

instead of

throw
`-+ 'signed char *'
  |-( 'container(std :: string|wstring|u16string|u32string)'
  | `-"Error: " 'const char *'
  `-( 'signed char *'
    |-strerror
    `-errnum 'signed int'

```
throw (std::string)"Error: " + strerror(errnum);
```
would result in a broken ast:
```
throw
`-::
  |-std
  `-string
```
instead of
```
throw
`-+ 'signed char *'
  |-( 'container(std :: string|wstring|u16string|u32string)'
  | `-"Error: " 'const char *'
  `-( 'signed char *'
    |-strerror
    `-errnum 'signed int'
```

@danmar danmar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. if CI will be happy I think this can be merged.

@danmar danmar merged commit 7c3afa0 into cppcheck-opensource:main Nov 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants