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

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

Closed
gzliudan opened this issue Jun 26, 2020 · 2 comments · Fixed by #2224
Closed

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

gzliudan opened this issue Jun 26, 2020 · 2 comments · Fixed by #2224
Assignees
Labels
Milestone

Comments

@gzliudan
Copy link

gzliudan commented Jun 26, 2020

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

Thanks for reporting! Looks like this is a leftover from #2203. I will create a fix.

nlohmann added a commit that referenced this issue Jun 27, 2020
@nlohmann nlohmann added the solution: proposed fix a fix for the issue has been proposed and waits for confirmation label Jun 27, 2020
@nlohmann nlohmann added this to the Release 3.8.1 milestone Jun 27, 2020
@gzliudan
Copy link
Author

thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants