[clang] [NFC][LifetimeSafety] Add experimental_invalidates annotation (PR #186799)

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 16 08:07:29 PDT 2026


================
@@ -277,7 +277,36 @@ bool isUniquePtrRelease(const CXXMethodDecl &MD) {
          MD.getNumParams() == 0 && isStdUniquePtr(*MD.getParent());
 }
 
+static bool hasInvalidatesAttr(const TypeSourceInfo &TSI) {
+  // Walk through the type layers looking for an annotate attribute.
----------------
Xazax-hun wrote:

I think we have similar patterns elsewhere in Clang, traversing TypeSourceInfo for an attribute. I wonder if we should have a templated function somewhere. Does not necessarily need to address in this PR but might be nice to have a good first issue ticket or something similar. 

https://github.com/llvm/llvm-project/pull/186799


More information about the cfe-commits mailing list