[clang] [clang][Sema][ThreadSafety] Accept attributes without arguments as meaning 'this' (PR #242937)
Aaron Puchert via cfe-commits
cfe-commits at lists.llvm.org
Sun Nov 29 16:41:06 PST 2026
https://github.com/aaronpuchert requested changes to this pull request.
What I don't understand about this: a non-static member function actually has an (implicit) `this` argument, i.e. callers pass the address of the object it is supposed to operate on. A function pointer member is just a function pointer. Calling it doesn't provide the function with an address of the object. If you copy that function pointer into a different object, the function will do the same operation even though the object is different. So I don't think this makes a lot of sense to me.
Where it should make sense is on member function pointers, because they also have an implicit `this` argument. But it should refer to the argument passed into the function, not the object such a member is contained in.
https://github.com/llvm/llvm-project/pull/242937
More information about the cfe-commits
mailing list