-
Notifications
You must be signed in to change notification settings - Fork 50
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
Add the [[nodiscard]] attribute to the result class #72
base: develop
Are you sure you want to change the base?
Conversation
The difficulty with these failures is that with LEAF being a standalone library, it doesn't use Boost Config. We need the correct compiler-specific ifdefs in leaf/config.hpp. |
Not sure I understand, the macro in question is already defined in leaf/config.hpp, line 212. #if defined(__has_attribute) && defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x5130)
# if __has_attribute(nodiscard)
# define BOOST_LEAF_ATTRIBUTE_NODISCARD [[nodiscard]]
# endif
#elif defined(__has_cpp_attribute)
//clang-6 accepts [[nodiscard]] with -std=c++14, but warns about it -pedantic
# if __has_cpp_attribute(nodiscard) && !(defined(__clang__) && (__cplusplus < 201703L)) && !(defined(__GNUC__) && (__cplusplus < 201100))
# define BOOST_LEAF_ATTRIBUTE_NODISCARD [[nodiscard]]
# endif
#endif
#ifndef BOOST_LEAF_ATTRIBUTE_NODISCARD
# define BOOST_LEAF_ATTRIBUTE_NODISCARD
#endif
|
I mean the ifdefs are not correct, we need to inspect the error logs to see what's the problem. The goal is to make leaf/config.hpp behave the same as boost/config.hpp (which I presume is correct) in terms of detecting the relevant [nodiscard] support in various compiler versions. I might be able look into it during the weekend. |
The logs don't end at line 49, it just takes a while for github to fetch the whole thing. The logs are tens of thousands of lines long, that's why. :) |
This reverts commit a2958ec.
I've reverted the changes to see if all tests pass, as at a cursory look it seems that some of the errors are unrelated to the change. Let's see. edit: 2024-05-10T16:59:48.1125656Z In file included from ./boost/leaf/result.hpp:9:0, |
Yes, the issue is in the nodiscard macro. |
No description provided.