summaryrefslogtreecommitdiffstats
path: root/util/system/compiler.h
diff options
context:
space:
mode:
authorhalyavin <[email protected]>2022-08-05 13:16:26 +0300
committerhalyavin <[email protected]>2022-08-05 13:16:26 +0300
commit68d8479d07e0b689ba126cf2c159ae7f11afb9cf (patch)
tree92289178ebded927b8369e4eb1c931be730c6333 /util/system/compiler.h
parentf346528af256244b692e713a8b6891957ae58dc6 (diff)
Mark clear and reset methods as reinitializing the object.
This means, that moved-from object can be safely used after the call of such method. This attribute is used by clang-tidy which checks that moved-from objects are not used unless a reinitialization method is called first.
Diffstat (limited to 'util/system/compiler.h')
-rw-r--r--util/system/compiler.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/util/system/compiler.h b/util/system/compiler.h
index ba8ea4e3b70..d2054465977 100644
--- a/util/system/compiler.h
+++ b/util/system/compiler.h
@@ -636,6 +636,12 @@ _YandexAbort();
} while (0)
#endif
+#if defined(__clang__)
+ #define Y_REINITIALIZES_OBJECT [[clang::reinitializes]]
+#else
+ #define Y_REINITIALIZES_OBJECT
+#endif
+
#ifdef __cplusplus
void UseCharPointerImpl(volatile const char*);