[PATCH] D148381: [WIP][Clang] Add counted_by attribute

Yeoul Na via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 23 18:50:34 PDT 2023


rapidsna added inline comments.


================
Comment at: clang/lib/Sema/SemaDecl.cpp:17931
+  auto It = llvm::find_if(RD->fields(), [&](const FieldDecl *Field) {
+    return Field->getName() == ECA->getCountedByField()->getName();
+  });
----------------
What happens in this corner case where the `Field` is actually the field that the attribute appertains to?
```
struct foo {
  int count;
  int counted[__attribute__((counted_by(counted)))];
};

```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148381/new/

https://reviews.llvm.org/D148381



More information about the cfe-commits mailing list