aaronpuchert added a subscriber: rupprecht.
aaronpuchert added a comment.

@rupprecht, do you still do integration at Google? This patch might be 
interesting to try out, since it strengthens some warnings.



================
Comment at: clang/test/SemaCXX/warn-thread-safety-analysis.cpp:85-86
 
+template<typename T, typename U>
+U& operator->*(const SmartPtr<T>& ptr, U T::*p) { return ptr->*p; }
+
----------------
In case you're wondering, making this a member function prevents instantiating 
the class with non-class types:

```
error: member pointer refers into non-class type 'int'
  U& operator->*(U T::*p) const { return ptr_->*p; }
                      ^
note: in instantiation of template class 'SmartPtr<int>' requested here
SmartPtr<int> p;
              ^
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124966/new/

https://reviews.llvm.org/D124966

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to