Skip to content

clang 9.0 report warning: unused type alias 'size_type' [-Wunused-local-typedef] #2221

@gzliudan

Description

@gzliudan

When I use this project under clang 9.0, the compiler complaints below warning messages:

nlohmann/json/single_include/nlohmann/json.hpp:11437:15: warning: unused type alias 'size_type' [-Wunused-local-typedef]
        using size_type = typename BasicJsonType::size_type;
              ^
nlohmann/json/single_include/nlohmann/json.hpp:11510:15: warning: unused type alias 'size_type' [-Wunused-local-typedef]
        using size_type = typename BasicJsonType::size_type;
              ^
nlohmann/json/single_include/nlohmann/json.hpp:11570:15: warning: unused type alias 'size_type' [-Wunused-local-typedef]
        using size_type = typename BasicJsonType::size_type;
              ^
nlohmann/json/single_include/nlohmann/json.hpp:11620:15: warning: unused type alias 'size_type' [-Wunused-local-typedef]
        using size_type = typename BasicJsonType::size_type;
              ^
nlohmann/json/single_include/nlohmann/json.hpp:11663:15: warning: unused type alias 'size_type' [-Wunused-local-typedef]
        using size_type = typename BasicJsonType::size_type;
              ^
nlohmann/json/single_include/nlohmann/json.hpp:11704:15: warning: unused type alias 'size_type' [-Wunused-local-typedef]
        using size_type = typename BasicJsonType::size_type;

I have to block the above warning with the following code:

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-local-typedef"
#include <nlohmann/json.hpp>
#pragma clang diagnostic pop

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions