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] -Wparentheses on line 555 on single_include #1319

Closed
loumalouomega opened this issue Oct 25, 2018 · 5 comments
Closed

[Warning] -Wparentheses on line 555 on single_include #1319

loumalouomega opened this issue Oct 25, 2018 · 5 comments
Assignees
Labels
confirmed solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Milestone

Comments

@loumalouomega
Copy link

The following warning appears (I am using Clang 6.0):

/home/travis/build/KratosMultiphysics/Kratos/external_libraries/json/json.hpp:19250:15:   required from here
/home/travis/build/KratosMultiphysics/Kratos/external_libraries/json/json.hpp:555:45: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
         std::is_constructible<typename ConstructibleObjectType::key_type,
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         typename object_t::key_type>::value and
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
         std::is_same<typename object_t::mapped_type,

The line on the code is:

typename object_t::key_type>::value and

Thank you very much

@nlohmann
Copy link
Owner

Thanks for reporting! I already fixed this two branches that should be merged soon. I'll leave this issue open until the fix reached the develop branch.

@loumalouomega
Copy link
Author

Thanks

@nlohmann
Copy link
Owner

Before fixing it - @theodelrieu - is

    static constexpr bool value =
        std::is_constructible<typename ConstructibleObjectType::key_type,
        typename object_t::key_type>::value and
        std::is_same<typename object_t::mapped_type,
        typename ConstructibleObjectType::mapped_type>::value or
        (has_from_json<BasicJsonType,
         typename ConstructibleObjectType::mapped_type>::value or
         has_non_default_from_json <
         BasicJsonType,
         typename ConstructibleObjectType::mapped_type >::value);

correct and only needs parentheses?

@nlohmann
Copy link
Owner

This is now fixed in develop and in 3.4.0 to be released this week.

@nlohmann nlohmann self-assigned this Oct 30, 2018
@nlohmann nlohmann added the solution: proposed fix a fix for the issue has been proposed and waits for confirmation label Oct 30, 2018
nlohmann added a commit that referenced this issue Oct 30, 2018
@nlohmann nlohmann added this to the Release 3.4.0 milestone Oct 30, 2018
@loumalouomega
Copy link
Author

Hurray, thanks a lot

loumalouomega added a commit to KratosMultiphysics/Kratos that referenced this issue Oct 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Projects
None yet
Development

No branches or pull requests

2 participants