Paul =?utf-8?q?Heidekrüger?= <[email protected]>,
Paul =?utf-8?q?Heidekrüger?= <[email protected]>,
Paul =?utf-8?q?Heidekrüger?= <[email protected]>,
Paul =?utf-8?q?Heidekrüger?= <[email protected]>,
Paul =?utf-8?q?Heidekrüger?= <[email protected]>,
Paul =?utf-8?q?Heidekrüger?= <[email protected]>,
Paul =?utf-8?q?Heidekrüger?= <[email protected]>,
Paul =?utf-8?q?Heidekrüger?= <[email protected]>,
Paul =?utf-8?q?Heidekrüger?= <[email protected]>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/[email protected]>
================
@@ -0,0 +1,142 @@
+namespace std {
+ template<typename T, unsigned size>
+ struct array {
+ T operator[](unsigned i) {
+ return T{1};
+ }
+ T at(unsigned i) {
+ return T{1};
+ }
+ };
+
+ template<typename T, typename V>
+ struct map {
+ T operator[](unsigned i) {
+ return T{1};
+ }
+ T at(unsigned i) {
+ return T{1};
+ }
+ };
+
+ template<typename T>
+ struct unique_ptr {
+ T operator[](unsigned i) {
+ return T{1};
+ }
+ };
+
+ template<typename T>
+ struct span {
+ T operator[](unsigned i) {
+ return T{1};
+ }
+ };
+} // namespace std
+
+namespace json {
+ template<typename T>
+ struct node{
+ T operator[](unsigned i) {
+ return T{1};
+ }
+ };
+} // namespace json
+
+struct SubClass : std::array<int, 3> {};
+
+class ExcludedClass1 {
+ public:
+ int operator[](unsigned i) {
+ return 1;
+ }
+ int at(unsigned i) {
+ return 1;
+ }
+};
+
+class ExcludedClass2 {
+ public:
+ int operator[](unsigned i) {
+ return 1;
+ }
+ int at(unsigned i) {
+ return 1;
+ }
+};
+
+
+// RUN: %check_clang_tidy %s \
+// RUN: cppcoreguidelines-prefer-at-over-subscript-operator %t -- \
+// RUN: -config='{CheckOptions:
{cppcoreguidelines-prefer-at-over-subscript-operator.ExcludeClasses:
"ExcludedClass1;ExcludedClass2"}}'
----------------
5chmidti wrote:
`RUN` lines should be at the top of the file
https://github.com/llvm/llvm-project/pull/95220
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits