================
@@ -2261,6 +2261,21 @@ class UnsafeBufferUsageReporter : public 
UnsafeBufferUsageHandler {
         // note_unsafe_buffer_operation doesn't have this mode yet.
         assert(!IsRelatedToDecl && "Not implemented yet!");
         MsgParam = 3;
+      } else if (const auto *ECE = dyn_cast<ExplicitCastExpr>(Operation)) {
+        QualType destType = ECE->getType();
+        const uint64_t dSize = 
Ctx.getTypeSize(destType.getTypePtr()->getPointeeType());
+        if(const auto *CE =dyn_cast<CXXMemberCallExpr>(ECE->getSubExpr())) {
+
+          
if(CE->getRecordDecl()->getQualifiedNameAsString().compare("std::span"))
----------------
ziqingluo-90 wrote:

I'm a tiny bit skeptical that if the qualified name is always `std::span`.  
Maybe we can have a test like this:
```
using namespace std;
void f(span<int> buf) {
   BigTy *p = (BigTy *) buf.data();
}
```

https://github.com/llvm/llvm-project/pull/75650
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to