=?utf-8?q?Balázs_Kéri?= <[email protected]>,
=?utf-8?q?Balázs_Kéri?= <[email protected]>,
=?utf-8?q?Balázs_Kéri?= <[email protected]>,
=?utf-8?q?Balázs_Kéri?= <[email protected]>,
=?utf-8?q?Balázs_Kéri?= <[email protected]>,
=?utf-8?q?Balázs_Kéri?= <[email protected]>,
=?utf-8?q?Balázs_Kéri?= <[email protected]>,
=?utf-8?q?Balázs_Kéri?= <[email protected]>,
=?utf-8?q?Balázs_Kéri?= <[email protected]>,
=?utf-8?q?Balázs_Kéri?= <[email protected]>,
=?utf-8?q?Balázs_Kéri?= <[email protected]>,
=?utf-8?q?Balázs_Kéri?= <[email protected]>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/[email protected]>


================
@@ -0,0 +1,63 @@
+// RUN: %check_clang_tidy %s bugprone-cast-to-struct %t -- \
+// RUN:   -config="{CheckOptions: {bugprone-cast-to-struct.IgnoredCasts: 'int 
\*;struct S1 \*;TYPE \*;struct S2 \*;TYPE_P;struct S3 \*;struct S4 \*;struct S. 
\*'}}"
+
+struct S1 {
+};
+
+struct S2 {
+};
+
+struct S3 {
+};
+
+struct S4 {
+};
+
+typedef int TYPE;
+typedef int * TYPE_P;
+typedef unsigned char uchar;
+
+void test1(int *p0, TYPE *p1, TYPE_P p2) {
+  struct S1 *s1;
+  struct S4 *s4;
+
+  s1 = (struct S1 *)p0; // no warning
+  s1 = (struct S1 *)p1; // CHECK-MESSAGES: warning: casting a 'TYPE *' (aka 
'int *') pointer to a 'struct S1 *'
----------------
zwuis wrote:

Please verify line numbers and column numbers as well. Ditto elsewhere.

https://github.com/llvm/llvm-project/pull/153428
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to