Skip to content

Fix a shadowing warning#2536

Merged
nlohmann merged 1 commit into
developfrom
shadowing
Dec 16, 2020
Merged

Fix a shadowing warning#2536
nlohmann merged 1 commit into
developfrom
shadowing

Conversation

@nlohmann
Copy link
Copy Markdown
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
Copy Markdown

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.

3 participants