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

try_copy_to should be noexcept? #446

Open
bobbymcr opened this issue May 24, 2024 · 0 comments
Open

try_copy_to should be noexcept? #446

bobbymcr opened this issue May 24, 2024 · 0 comments

Comments

@bobbymcr
Copy link
Contributor

The wil::com_ptr_t method try_copy_to is supposed to be a non-exceptional way to copy the held COM interface pointer into a raw output pointer (potentially of a different interface type). However, it's not marked noexcept which can cause problems when using high warning levels on static analyzers (e.g. see C26447 from the C++ Core Guidelines checker). It seems like try_copy_to and the transitively called functions in query_policy should be marked noexcept, as they all return error codes and only interact with other non-exceptional APIs (e.g. QueryInterface).

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

No branches or pull requests

1 participant