Migrate ABSL_SCOPED_LOCKABLE to [[clang::scoped_lockable]]

PiperOrigin-RevId: 995543358
Change-Id: I567fdbd655228f602767dcd14e603ff5049f06fe
diff --git a/absl/base/thread_annotations.h b/absl/base/thread_annotations.h
index 4a3f3e3..cede48c 100644
--- a/absl/base/thread_annotations.h
+++ b/absl/base/thread_annotations.h
@@ -188,7 +188,9 @@
 // acquired, and the destructor should use `UNLOCK_FUNCTION()` with no
 // arguments; the analysis will assume that the destructor unlocks whatever the
 // constructor locked.
-#if ABSL_HAVE_ATTRIBUTE(scoped_lockable)
+#if ABSL_HAVE_CPP_ATTRIBUTE(clang::scoped_lockable)
+#define ABSL_SCOPED_LOCKABLE [[clang::scoped_lockable]]
+#elif ABSL_HAVE_ATTRIBUTE(scoped_lockable)
 #define ABSL_SCOPED_LOCKABLE __attribute__((scoped_lockable))
 #else
 #define ABSL_SCOPED_LOCKABLE