[clang] [clang] Don't consider the lifetimeboundCall when analyzing the gsl pointer construction. (PR #114044)
Gábor Horváth via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 29 06:11:13 PDT 2024
================
@@ -780,3 +780,30 @@ void test13() {
}
} // namespace GH100526
+
+namespace test {
+
+struct [[gsl::Pointer]] FooOwner {};
+struct [[gsl::Pointer]] FooPointer {
+ FooPointer(const FooOwner&);
+};
+
+template<typename T>
+struct [[gsl::Owner]] Container {
+ const T& get() const [[clang::lifetimebound]];
+};
+
+FooPointer func() {
----------------
Xazax-hun wrote:
Would we still warn after this fix if we returned `FooPointer&`?
https://github.com/llvm/llvm-project/pull/114044
More information about the cfe-commits
mailing list