[base] Document the limitations of threading annotatations.

Add comment to `base/thread_annotations.h` explaining that static
analysis is not done inside constructors and destructors.

Bug: None
Change-Id: I2a2883965ccf68581722fb01aedb5233f74ad113
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2764047
Reviewed-by: Benoit L <[email protected]>
Reviewed-by: Lei Zhang <[email protected]>
Commit-Queue: Thiabaud Engelbrecht <[email protected]>
Cr-Commit-Position: refs/heads/master@{#908991}
diff --git a/base/thread_annotations.h b/base/thread_annotations.h
index 33dab46f..479db6f3 100644
--- a/base/thread_annotations.h
+++ b/base/thread_annotations.h
@@ -7,6 +7,11 @@
 // code. The annotations can also help program analysis tools to identify
 // potential thread safety issues.
 //
+// Note that no analysis is done inside constructors and destructors,
+// regardless of what attributes are used. See
+// https://clang.llvm.org/docs/ThreadSafetyAnalysis.html#no-checking-inside-constructors-and-destructors
+// for details.
+//
 // Note that the annotations we use are described as deprecated in the Clang
 // documentation, linked below. E.g. we use EXCLUSIVE_LOCKS_REQUIRED where the
 // Clang docs use REQUIRES.