[clang] [clang][ThreadSafety] Fix a crash on a capability expression calling a pointer to member (PR #231995)

Marco Elver via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 15 06:46:22 PDT 2026


================
@@ -8147,6 +8147,41 @@ void test3() {
 
 } // namespace WideStringLiteral
 
+namespace PointerToMemberCall {
+
+struct Guarded {
+  Mutex mu;
+  int data GUARDED_BY(mu);
+  Mutex *(Guarded::*mu_of)();
+};
+
----------------
melver wrote:

Since all three functions exercise the same `->*` / `.*` callee translation to `Undefined` (and only test that each statement emits `cannot resolve lock expression` rather than lockset tracking), `testCallInCapabilityExprObjects` and `testCallInCapabilityExprMismatch` seem redundant with
  `testCallInCapabilityExpr` and could be folded into one function.

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


More information about the cfe-commits mailing list