This revision was automatically updated to reflect the committed changes. Closed by commit rGfd02a86260b3: [analyzer] Add system header simulator a symmetric random access iterator… (authored by gamesh411).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83226/new/ https://reviews.llvm.org/D83226 Files: clang/test/Analysis/Inputs/system-header-simulator-cxx.h clang/test/Analysis/diagnostics/explicit-suppression.cpp Index: clang/test/Analysis/diagnostics/explicit-suppression.cpp =================================================================== --- clang/test/Analysis/diagnostics/explicit-suppression.cpp +++ clang/test/Analysis/diagnostics/explicit-suppression.cpp @@ -19,6 +19,6 @@ void testCopyNull(C *I, C *E) { std::copy(I, E, (C *)0); #ifndef SUPPRESSED - // expected-warning@../Inputs/system-header-simulator-cxx.h:699 {{Called C++ object pointer is null}} + // expected-warning@../Inputs/system-header-simulator-cxx.h:709 {{Called C++ object pointer is null}} #endif } Index: clang/test/Analysis/Inputs/system-header-simulator-cxx.h =================================================================== --- clang/test/Analysis/Inputs/system-header-simulator-cxx.h +++ clang/test/Analysis/Inputs/system-header-simulator-cxx.h @@ -60,6 +60,11 @@ __vector_iterator<T, Ptr, Ref> operator+(difference_type n) { return ptr + n; } + friend __vector_iterator<T, Ptr, Ref> operator+( + difference_type n, + const __vector_iterator<T, Ptr, Ref> &iter) { + return n + iter.ptr; + } __vector_iterator<T, Ptr, Ref> operator-(difference_type n) { return ptr - n; } @@ -118,6 +123,11 @@ __deque_iterator<T, Ptr, Ref> operator+(difference_type n) { return ptr + n; } + friend __deque_iterator<T, Ptr, Ref> operator+( + difference_type n, + const __deque_iterator<T, Ptr, Ref> &iter) { + return n + iter.ptr; + } __deque_iterator<T, Ptr, Ref> operator-(difference_type n) { return ptr - n; }
Index: clang/test/Analysis/diagnostics/explicit-suppression.cpp =================================================================== --- clang/test/Analysis/diagnostics/explicit-suppression.cpp +++ clang/test/Analysis/diagnostics/explicit-suppression.cpp @@ -19,6 +19,6 @@ void testCopyNull(C *I, C *E) { std::copy(I, E, (C *)0); #ifndef SUPPRESSED - // expected-warning@../Inputs/system-header-simulator-cxx.h:699 {{Called C++ object pointer is null}} + // expected-warning@../Inputs/system-header-simulator-cxx.h:709 {{Called C++ object pointer is null}} #endif } Index: clang/test/Analysis/Inputs/system-header-simulator-cxx.h =================================================================== --- clang/test/Analysis/Inputs/system-header-simulator-cxx.h +++ clang/test/Analysis/Inputs/system-header-simulator-cxx.h @@ -60,6 +60,11 @@ __vector_iterator<T, Ptr, Ref> operator+(difference_type n) { return ptr + n; } + friend __vector_iterator<T, Ptr, Ref> operator+( + difference_type n, + const __vector_iterator<T, Ptr, Ref> &iter) { + return n + iter.ptr; + } __vector_iterator<T, Ptr, Ref> operator-(difference_type n) { return ptr - n; } @@ -118,6 +123,11 @@ __deque_iterator<T, Ptr, Ref> operator+(difference_type n) { return ptr + n; } + friend __deque_iterator<T, Ptr, Ref> operator+( + difference_type n, + const __deque_iterator<T, Ptr, Ref> &iter) { + return n + iter.ptr; + } __deque_iterator<T, Ptr, Ref> operator-(difference_type n) { return ptr - n; }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits