Skip to content

C++: Fix false-positive in 'cpp/incorrect-allocation-error-handling' #6471

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

Merged

Conversation

MathiasVP
Copy link
Contributor

Fixes #6435.

Turns out we didn't recognize the std::nothrow parameter in void *operator new(std::size_t, const std::nothrow_t &); because it was hidden behind a reference type.

We didn't catch this in the original PR because I included a noexcept specifier in all of the overloads where we had a std::nothrow_t & parameter 🤦 .

…er, but not a 'noexcept' specifier. This case was previously not reported because of the 'noexcept' specifier, and apparently the 'std::nothrow' case was broken all along.
Copy link
Contributor

@geoffw0 geoffw0 left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM.

Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
Copy link
Contributor

@geoffw0 geoffw0 left a comment

Choose a reason for hiding this comment

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

👍

@geoffw0 geoffw0 merged commit 3f72a1a into github:main Aug 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++ no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LGTM.com - cpp/incorrect-allocation-error-handling false positive with std::nothrow
2 participants