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

Warning for shadowed variables #3188

Closed
kernie opened this issue Dec 11, 2021 · 0 comments · Fixed by #3193
Closed

Warning for shadowed variables #3188

kernie opened this issue Dec 11, 2021 · 0 comments · Fixed by #3193
Assignees
Labels
release item: 🔨 further change solution: proposed fix a fix for the issue has been proposed and waits for confirmation

Comments

@kernie
Copy link
Contributor

kernie commented Dec 11, 2021

Hi,

wanted to report that I compiled a project that is based on nlohmann::json v3.10.4 and it used -Wshadow with the GNU g++ v7.5.
During compilation I see

json/single_include/nlohmann/json.hpp:18813:5: warning: declaration of 'count' shadows a member of 'nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType>' [-Wshadow]
     {
     ^
json/single_include/nlohmann/json.hpp:22078:15: note: shadowed declaration is here
     size_type count(KeyT&& key) const
               ^~~~~

Maybe worth looking into...
Thanks

kernie pushed a commit to kernie/json that referenced this issue Dec 14, 2021
@nlohmann nlohmann linked a pull request Dec 17, 2021 that will close this issue
4 tasks
@nlohmann nlohmann self-assigned this Dec 17, 2021
@nlohmann nlohmann added release item: 🔨 further change solution: proposed fix a fix for the issue has been proposed and waits for confirmation labels Dec 17, 2021
@nlohmann nlohmann added this to the Release 3.10.5 milestone Dec 17, 2021
nlohmann pushed a commit that referenced this issue Dec 17, 2021
* Rename variable count to resolve shadowing (#3188)

* Amalgamate: Rename variable count to resolve shadowing (#3188)

Co-authored-by: Maarten Becker <maarten.becker@nuc-eng.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release item: 🔨 further change solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants