You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.
I did a quick look into this. Using the following diff:
diff --git a/clang/lib/Sema/SemaAttr.cpp b/clang/lib/Sema/SemaAttr.cpp
index acf06cc9cae..749ee891071 100644
--- a/clang/lib/Sema/SemaAttr.cpp
+++ b/clang/lib/Sema/SemaAttr.cpp
@@ -133,6 +133,14 @@ void Sema::inferGslPointerAttribute(NamedDecl *ND,
Containers.count(Parent->getName()))
addGslOwnerPointerAttributeIfNotExisting<PointerAttr>(Context,
UnderlyingRecord);
+ // The vector<bool>::reference is a pointer.
+ // TODO: The code below should work for most cases, but pre C++11 it
+ // it possible to have a non-record reference type for non-bool vectors
+ // that have custom allocators. Check if the template argument is bool!
+ if (Parent->isInStdNamespace() && ND->getName() == "reference" &&
+ Parent->getName() == "vector")
+ addGslOwnerPointerAttributeIfNotExisting<PointerAttr>(Context,
+ UnderlyingRecord);
}
void Sema::inferGslPointerAttribute(TypedefNameDecl *TD) {
I was able to make the proxy class annotated. However, in the meantime, I realized the std::vector<bool> specialization is not annotated as Owner.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Move the code from
llvm-project/clang/lib/Analysis/LifetimeTypeCategory.cpp
Line 126 in 6c22919
The text was updated successfully, but these errors were encountered: