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

Bug: clang-tidy "clang-analyzer-core.StackAddressEscape" being triggered #90

Open
rianquinn opened this issue May 29, 2018 · 1 comment

Comments

@rianquinn
Copy link

When using hippomocks with xxxFunc calls, clang-tidy's clang-analyzer-core.StackAddressEscape check is triggering.

@kenfred
Copy link

kenfred commented Dec 11, 2018

I have the same issue, but it is tied to MockRepository.

In the function:

void SomeFunc()
{
    MockRepository mocks;
}

I get the following clang-tidy error:
Address of stack memory associated with local variable 'mocks' is still referred to by the global variable 'instance' upon returning to the caller. This will be a dangling reference [clang-analyzer-core.StackAddressEscape,-warnings-as-errors]

This would appear to be an issue with clang-tidy, because I find in the destructor of MockRepository that the instance singleton is being cleared.

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

2 participants