File tree Expand file tree Collapse file tree 3 files changed +7
-9
lines changed
test/SemaCXX/warn-unsafe-buffer-usage-debug-unclaimed Expand file tree Collapse file tree 3 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -13241,7 +13241,7 @@ def warn_unsafe_buffer_usage_in_container : Warning<
1324113241 "the two-parameter std::span construction is unsafe as it can introduce mismatch between buffer size and the bound information">,
1324213242 InGroup<UnsafeBufferUsageInContainer>, DefaultIgnore;
1324313243def warn_unsafe_buffer_usage_unique_ptr_array_access : Warning<"direct access using operator[] on std::unique_ptr<T[]> is unsafe due to lack of bounds checking">,
13244- InGroup<UnsafeBufferUsageInUniquePtrArray >, DefaultIgnore;
13244+ InGroup<UnsafeBufferUsageInUniquePtrArrayAccess >, DefaultIgnore;
1324513245#ifndef NDEBUG
1324613246// Not a user-facing diagnostic. Useful for debugging false negatives in
1324713247// -fsafe-buffer-usage-suggestions (i.e. lack of -Wunsafe-buffer-usage fixits).
Original file line number Diff line number Diff line change @@ -2732,10 +2732,13 @@ std::set<const Expr *> clang::findUnsafePointers(const FunctionDecl *FD) {
27322732 const VariableGroupsManager &, FixItList &&,
27332733 const Decl *,
27342734 const FixitStrategy &) override {}
2735- bool isSafeBufferOptOut (const SourceLocation &) const override {
2735+ void handleUnsafeUniquePtrArrayAccess (const DynTypedNode &Node,
2736+ bool IsRelatedToDecl,
2737+ ASTContext &Ctx) override {}
2738+ bool ignoreUnsafeBufferInContainer (const SourceLocation &) const override {
27362739 return false ;
27372740 }
2738- bool ignoreUnsafeBufferInContainer (const SourceLocation &) const override {
2741+ bool isSafeBufferOptOut (const SourceLocation &) const override {
27392742 return false ;
27402743 }
27412744 bool ignoreUnsafeBufferInLibcCall (const SourceLocation &) const override {
@@ -2747,10 +2750,6 @@ std::set<const Expr *> clang::findUnsafePointers(const FunctionDecl *FD) {
27472750 }
27482751 };
27492752
2750- void handleUnsafeUniquePtrArrayAccess (const DynTypedNode &Node,
2751- bool IsRelatedToDecl,
2752- ASTContext &Ctx) override {}
2753-
27542753 FixableGadgetList FixableGadgets;
27552754 WarningGadgetList WarningGadgets;
27562755 DeclUseTracker Tracker;
Original file line number Diff line number Diff line change @@ -43,8 +43,7 @@ template <class T> class unique_ptr {
4343
4444void basic_unique_ptr () {
4545 std::unique_ptr<int []> p1;
46- p1[0 ]; // expected-warning{{direct access using operator[] on
47- // std::unique_ptr<T[]> is unsafe due to lack of bounds checking}}
46+ p1[0 ]; // expected-warning{{direct access using operator[] on std::unique_ptr<T[]> is unsafe due to lack of bounds checking}}
4847}
4948
5049// CHECK: Root # 1
You can’t perform that action at this time.
0 commit comments