IamYJLee wrote:
@zeyi2
Could you advise me on how to add the code to the test?
Is it okay to define a class with operator[]?
```cpp
struct Whatever {};
class SimpleMap {
public:
int &operator[](const Base *);
};
template <typename T>
struct TemplateHolder : Base, T {
SimpleMap _map;
void test() {
auto &x = _map[this];
// no-warning
(void)x;
}
};
```
https://github.com/llvm/llvm-project/pull/187452
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits