diff --git a/include/sled/lang/attributes.h b/include/sled/lang/attributes.h index 0d3158d..2702cf7 100644 --- a/include/sled/lang/attributes.h +++ b/include/sled/lang/attributes.h @@ -14,7 +14,8 @@ #if defined(GUARDED_BY) #undef GUARDED_BY #endif -#define GUARDED_BY(x) __attribute__((guarded_by(x))) + +#define GUARDED_BY(x) THREAD_ANNOTATION_ATTRIBUTE__(guarded_by(x)) #if defined(__clang__) #define EXCLUSIVE_TRYLOCK_FUNCTION(...) THREAD_ANNOTATION_ATTRIBUTE__(exclusive_trylock_function(__VA_ARGS__)) diff --git a/include/sled/status_or.h b/include/sled/status_or.h index 1b3caec..e58bfe2 100644 --- a/include/sled/status_or.h +++ b/include/sled/status_or.h @@ -96,13 +96,13 @@ public: T &&value() && { CheckHasValue(); - return **this; + return std::move(**this); } T const &&value() const && { CheckHasValue(); - return **this; + return std::move(**this); } T &value_or(T &&val) &