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
Build warnings: shadowing exception id #776
Comments
Thanks for reporting. Is this an ICC warning? |
Indeed, troubles ahead! I didn't take a detailed look to 3.0 exceptions but I think the member The naming convention I usually have is to prefix private member variables with an underscore. |
@theodelrieu In class exception, |
Yep that will suffice |
Can I close this issue? |
Yes it works, and I didn't mean to close it, I'll leave that to you, thanks! |
Thanks for checking back! |
Hi,
I get a bunch of build warnings (see below) that inform on hiding the exception member 'id'. To me it seems the member is not needed as the id is always passed through the calling functions. Looks like a potential source of trouble to me.
Best regards,
Peter
warnings:
In file included from .*******: ********json/json.hpp(209): warning #3280: declaration hides member "nlohmann::detail::exception::id" (declared at line 204)
static std::string name(const std::string& ename, int id)
^
********json/json.hpp(273): warning #3280: declaration hides member "nlohmann::detail::exception::id" (declared at line 204)
static parse_error create(int id, std::size_t byte_, const std::string& what_arg)
^
********json/json.hpp(337): warning #3280: declaration hides member "nlohmann::detail::exception::id" (declared at line 204)
static invalid_iterator create(int id, const std::string& what_arg)
^
********json/json.hpp(388): warning #3280: declaration hides member "nlohmann::detail::exception::id" (declared at line 204)
static type_error create(int id, const std::string& what_arg)
^
********json/json.hpp(431): warning #3280: declaration hides member "nlohmann::detail::exception::id" (declared at line 204)
static out_of_range create(int id, const std::string& what_arg)
^
********json/json.hpp(469): warning #3280: declaration hides member "nlohmann::detail::exception::id" (declared at line 204)
static other_error create(int id, const std::string& what_arg)
The text was updated successfully, but these errors were encountered: