Skip to content

Commit ebd8dfe

Browse files
clang-tidy: readability-redundant-smartptr-get does not remove (#97964)
simplified testcase
1 parent e012904 commit ebd8dfe

File tree

1 file changed

+1
-25
lines changed

1 file changed

+1
-25
lines changed

clang-tools-extra/test/clang-tidy/checkers/readability/redundant-smartptr-get.cpp

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,7 @@ struct vector {
2828
unsigned long size() const;
2929
bool empty() const;
3030

31-
// Basic iterator implementation for testing
32-
struct iterator {
33-
T* ptr;
34-
iterator(T* p) : ptr(p) {}
35-
T& operator*() { return *ptr; }
36-
T* operator->() { return ptr; }
37-
iterator& operator++() {
38-
++ptr;
39-
return *this;
40-
}
41-
bool operator!=(const iterator& other) const { return ptr != other.ptr; }
42-
};
31+
using iterator = T*;
4332

4433
iterator begin();
4534
iterator end();
@@ -48,19 +37,6 @@ struct vector {
4837
unsigned long sz;
4938
};
5039

51-
template <typename T>
52-
vector<T>::vector() : data(nullptr), sz(0) {}
53-
54-
template <typename T>
55-
typename vector<T>::iterator vector<T>::begin() {
56-
return iterator(data);
57-
}
58-
59-
template <typename T>
60-
typename vector<T>::iterator vector<T>::end() {
61-
return iterator(data + sz);
62-
}
63-
6440
} // namespace std
6541

6642
struct Bar {

0 commit comments

Comments
 (0)