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: use of the 'nodiscard' attribute is a C++17 extension #1557

Closed
bvnp44 opened this issue Apr 4, 2019 · 2 comments
Closed

warning: use of the 'nodiscard' attribute is a C++17 extension #1557

bvnp44 opened this issue Apr 4, 2019 · 2 comments
Labels
kind: bug solution: duplicate the issue is a duplicate; refer to the linked issue instead

Comments

@bvnp44
Copy link

bvnp44 commented Apr 4, 2019

  • What is the issue you have?

warning: use of the 'nodiscard' attribute is a C++17 extension

  • Please describe the steps to reproduce the issue. Can you provide a small but working code example?

mac os, cmake, clang

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wfatal-errors -pedantic -fPIC")
  • What is the expected behavior?

there were no this warnings in v3.5.0

  • And what is the actual behavior instead?
nlohmann/json.hpp:13087:5: use warningof:  the 'nodiscard' useattribute  ofis  thea  'nodiscard'C++17  attributeextension  is[-Wc++17-extensions] a
 C++17 extension [-Wc++17-extensions]
    JSON_NODISCARD    JSON_NODISCARD

    ^    ^
g++ -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 10.0.1 (clang-1001.0.46.3)
Target: x86_64-apple-darwin18.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
  • Did you use a released version of the library or the version from the develop branch?

tag 3.6.1

@bvnp44
Copy link
Author

bvnp44 commented Apr 4, 2019

seems duplicate

@bvnp44 bvnp44 closed this as completed Apr 4, 2019
@nlohmann
Copy link
Owner

nlohmann commented Apr 4, 2019

Duplicate of #1535. Will be part of the 3.6.2 release.

@nlohmann nlohmann added the solution: duplicate the issue is a duplicate; refer to the linked issue instead label Apr 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug solution: duplicate the issue is a duplicate; refer to the linked issue instead
Projects
None yet
Development

No branches or pull requests

2 participants