================ @@ -6875,6 +6875,34 @@ class PointerGuard { }; } // namespace Derived_Smart_Pointer +// Test for capabilities that are heap-allocated and stored in static variables. +namespace FunctionStaticVariable { +struct Data { + Mutex mu; + int x GUARDED_BY(mu); +}; + +void testStaticVariable() { +} + +void testHeapAllocation() { + static Data *d = new Data; ---------------- melver wrote:
Right, I started translateCXXNewExpr() because of this case, but then ended up solving this by ignoring isStaticLocal() variables - I've now moved that fix to the first patch as well. So what's left for the translateCXXNewExpr patch is the `testStrangePattern()` test case, which would fail without it. https://github.com/llvm/llvm-project/pull/142955 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits