================
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -fsyntax-only -ast-dump %s | FileCheck %s
+
+// Verifying that CThisExpr generation works for sturct fields
+struct Packet {
+ int size;
+ int *data __attribute__((counted_by(size)));
+};
+
+// CHECK: RecordDecl {{.*}} struct Packet definition
+// CHECK: FieldDecl {{.*}} size 'int'
+// CHECK: FieldDecl {{.*}} data 'int * __counted_by(this->size)':'int *'
----------------
Caryoake wrote:
Since the general consensus seems to be that __counted_by(size) is preferred
over having the "this" inside it, I have implemented it as that itself.
https://github.com/llvm/llvm-project/pull/199241
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits