NoQ added a comment.

This looks outright correct to me. I have random suggestions on note text here 
and there.



================
Comment at: clang/test/Analysis/smart-ptr-text-output.cpp:132
+  std::unique_ptr<A> PToMove; // expected-note {{Default constructed smart 
pointer 'PToMove' is null}}
+  P = std::move(PToMove); // expected-note {{Smart pointer 'P' is null after a 
null value moved from 'PToMove'}}
+  P->foo(); // expected-warning {{Dereference of null smart pointer 'P' 
[alpha.cplusplus.SmartPtr]}}
----------------
I suggest: `Null pointer value move-assigned to 'P'`.


================
Comment at: clang/test/Analysis/smart-ptr-text-output.cpp:139
+  std::unique_ptr<A> P;
+  P = std::move(PToMove); // expected-note {{Smart pointer 'PToMove' is null 
after moved and assigned to 'P'}}
+  PToMove->foo(); // expected-warning {{Dereference of null smart pointer 
'PToMove' [alpha.cplusplus.SmartPtr]}}
----------------
I suggest: `Smart pointer 'PToMove' is null; previous value moved to 'P'`. Or 
maybe instead keep the note that the move-checker currently emits?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86293

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

Reply via email to