Skip to content

Commit 98cbea5

Browse files
committed
merge testcase to main test file
1 parent e006c0d commit 98cbea5

File tree

2 files changed

+22
-19
lines changed

2 files changed

+22
-19
lines changed

clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/pro-bounds-pointer-arithmetic-issue126424.cpp

Lines changed: 0 additions & 19 deletions
This file was deleted.

clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/pro-bounds-pointer-arithmetic.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,25 @@ void okay() {
8787

8888
for(int ii : a) ; // OK, pointer arithmetic generated by compiler
8989
}
90+
91+
namespace issue126424 {
92+
93+
namespace std {
94+
template <typename, typename>
95+
class pair {};
96+
97+
template <typename Key, typename Value>
98+
class map {
99+
public:
100+
using value_type = pair<Key, Value>;
101+
value_type& operator[](const Key& key);
102+
value_type& operator[](Key&& key);
103+
};
104+
}
105+
106+
template <typename R>
107+
int f(std::map<R*, int>& map, R* r) {
108+
return map[r]; // OK
109+
}
110+
111+
}

0 commit comments

Comments
 (0)