================
@@ -449,6 +461,35 @@ static bool checkFunParamsAreScopedLockable(Sema &S,
   return false;
 }
 
+static bool checkThreadSafetyAttrSubject(Sema &S, Decl *D, const ParsedAttr 
&AL,
+                                         bool CheckParmVar = false) {
+  const auto *VD = dyn_cast<ValueDecl>(D);
+  if (!VD || isa<FunctionDecl>(VD))
+    return true;
+
+  if (CheckParmVar) {
+    if (const auto *ParmDecl = dyn_cast<ParmVarDecl>(VD))
+      return checkFunParamsAreScopedLockable(S, ParmDecl, AL);
+  }
+
+  return checkThreadSafetyValueDeclIsFunPtr(S, VD, AL);
+}
+
+/// Recheck instantiated thread-safety attributes that could not be validated
+/// on the dependent pattern declaration.
+bool Sema::checkDependentThreadSafetyAttrs(Decl *D, const Attr *A) {
+  if (!isa<AssertCapabilityAttr, AcquireCapabilityAttr,
+           TryAcquireCapabilityAttr, ReleaseCapabilityAttr,
+           RequiresCapabilityAttr, LocksExcludedAttr>(A))
+    return true;
+
+  const auto *VD = dyn_cast<ValueDecl>(D);
+  if (!VD || isa<FunctionDecl, ParmVarDecl>(VD))
----------------
melver wrote:

you're right. fixed, along with a small test to catch this.

https://github.com/llvm/llvm-project/pull/191187
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to