diff options
Diffstat (limited to 'absl/status/internal/statusor_internal.h')
-rw-r--r-- | absl/status/internal/statusor_internal.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/absl/status/internal/statusor_internal.h b/absl/status/internal/statusor_internal.h index 7cc76256..eaac2c0b 100644 --- a/absl/status/internal/statusor_internal.h +++ b/absl/status/internal/statusor_internal.h @@ -17,6 +17,7 @@ #include <type_traits> #include <utility> +#include "absl/base/attributes.h" #include "absl/meta/type_traits.h" #include "absl/status/status.h" #include "absl/utility/utility.h" @@ -135,18 +136,14 @@ class Helper { public: // Move type-agnostic error handling to the .cc. static void HandleInvalidStatusCtorArg(Status*); - static void Crash(const absl::Status& status); + ABSL_ATTRIBUTE_NORETURN static void Crash(const absl::Status& status); }; // Construct an instance of T in `p` through placement new, passing Args... to // the constructor. // This abstraction is here mostly for the gcc performance fix. template <typename T, typename... Args> -void PlacementNew(void* p, Args&&... args) { -#if defined(__GNUC__) && !defined(__clang__) - // Teach gcc that 'p' cannot be null, fixing code size issues. - if (p == nullptr) __builtin_unreachable(); -#endif +ABSL_ATTRIBUTE_NONNULL(1) void PlacementNew(void* p, Args&&... args) { new (p) T(std::forward<Args>(args)...); } |