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

Fix a shadowing warning #2536

Merged
merged 1 commit into from
Dec 16, 2020
Merged

Fix a shadowing warning #2536

merged 1 commit into from
Dec 16, 2020

Conversation

nlohmann
Copy link
Owner

This PR fixes a shadowing warning detected by Cppcheck (see #1759).

single_include/nlohmann/json.hpp:17502:47: style: Local variable 'object' shadows outer function [shadowFunction]
        std::unique_ptr<T, decltype(deleter)> object(AllocatorTraits::allocate(alloc, 1), deleter);
                                              ^
single_include/nlohmann/json.hpp:18403:23: note: Shadowed declaration
    static basic_json object(initializer_list_t init = {})
                      ^
single_include/nlohmann/json.hpp:17502:47: note: Shadow variable
        std::unique_ptr<T, decltype(deleter)> object(AllocatorTraits::allocate(alloc, 1), deleter);
                                              ^

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 5cc5285 on shadowing into 2fc1f69 on develop.

@nlohmann nlohmann self-assigned this Dec 16, 2020
@nlohmann nlohmann added this to the Release 3.9.2 milestone Dec 16, 2020
@nlohmann nlohmann merged commit 4581008 into develop Dec 16, 2020
@nlohmann nlohmann deleted the shadowing branch December 16, 2020 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants