[clang] Turn 'counted_by' into a type attribute and parse it into 'CountAttributedType' (PR #78000)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 27 12:13:02 PST 2024


================
@@ -4259,7 +4240,7 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E,
       if (const auto *ME = dyn_cast<MemberExpr>(Array);
           ME &&
           ME->isFlexibleArrayMemberLike(getContext(), StrictFlexArraysLevel) &&
-          ME->getMemberDecl()->hasAttr<CountedByAttr>()) {
+          ME->getMemberDecl()->getType()->getAs<CountAttributedType>()) {
----------------
AaronBallman wrote:

```suggestion
          isa<CountAttributedType>(ME->getMemberDecl()->getType()) {
```

https://github.com/llvm/llvm-project/pull/78000


More information about the cfe-commits mailing list