Skip to content

Commit 0df2ed8

Browse files
Abseil Teamcopybara-github
authored andcommitted
Restrict ABSL_ATTRIBUTE_NULL_AFTER_MOVE to clang >= 12.0, when support for
multiple clang::annotate arguments was added. PiperOrigin-RevId: 904794075 Change-Id: Ie633d9a000d65386d64e6b43bbb15c3e7b5905b4
1 parent f58ee26 commit 0df2ed8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

absl/base/attributes.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,8 @@
541541
// The clang-tidy check bugprone-use-after-move allows member functions of types
542542
// marked with this attribute to be called on objects that have been moved from;
543543
// without the attribute, this would result in a use-after-move warning.
544-
#if ABSL_HAVE_CPP_ATTRIBUTE(clang::annotate)
544+
#if ABSL_HAVE_CPP_ATTRIBUTE(clang::annotate) && defined(__clang__) && \
545+
__clang_major__ >= 12
545546
#define ABSL_ATTRIBUTE_NULL_AFTER_MOVE \
546547
[[clang::annotate("clang-tidy", "bugprone-use-after-move", \
547548
"null_after_move")]]

0 commit comments

Comments
 (0)