================ @@ -990,13 +1009,16 @@ static void checkExprLifetimeImpl(Sema &SemaRef, // int &p = *localUniquePtr; // someContainer.add(std::move(localUniquePtr)); // return p; - IsLocalGslOwner = isRecordWithAttr<OwnerAttr>(L->getType()); + IsLocalGslOwner = + isRecordWithAttr<OwnerAttr>(L->getType()) && + !isContainerOfPointer(L->getType()->getAsRecordDecl()); ---------------- usx95 wrote:
This looks useful to be a extracted to a separate function, `IsGSLOwner`. This could be used to replace the use below as well. There are other instances `!isRecordWithAttr<OwnerAttr>` which can be replaced as a no-op as well. It would make it more consistent and easy to follow. https://github.com/llvm/llvm-project/pull/107213 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits