File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -2606,6 +2606,19 @@ class UnsafeBufferUsageReporter : public UnsafeBufferUsageHandler {
26062606#endif
26072607 }
26082608
2609+ void handleUnsafeUniquePtrArrayAccess (const DynTypedNode &Node,
2610+ bool IsRelatedToDecl,
2611+ ASTContext &Ctx) override {
2612+ SourceLocation Loc;
2613+ std::string Message;
2614+
2615+ Loc = Node.get <Stmt>()->getBeginLoc ();
2616+ Message = " Direct operator[] access on std::unique_ptr<T[]> is unsafe "
2617+ " (no bounds check)." ;
2618+ S.Diag (Loc, diag::warn_unsafe_buffer_usage_unique_ptr_array_access)
2619+ << Message << Node.getSourceRange ();
2620+ }
2621+
26092622 bool isSafeBufferOptOut (const SourceLocation &Loc) const override {
26102623 return S.PP .isSafeBufferOptOut (S.getSourceManager (), Loc);
26112624 }
You can’t perform that action at this time.
0 commit comments