[PATCH] D64256: Teach some warnings to respect gsl::Pointer and gsl::Owner attributes
Dmitri Gribenko via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 6 04:37:05 PDT 2019
gribozavr accepted this revision.
gribozavr added inline comments.
================
Comment at: clang/lib/Sema/SemaInit.cpp:7031
+ LLVM_FALLTHROUGH;
+ case IndirectLocalPathEntry::DefaultInit:
return Path[I].E->getSourceRange();
----------------
This change would be best committed separately (preferably with a test).
================
Comment at: clang/lib/Sema/SemaInit.cpp:7046
+ }
+ return GslPointerInits;
+}
----------------
I think you can go back to llvm::c_find now?
================
Comment at: clang/lib/Sema/SemaInit.cpp:7076
+ // int &p = *localOwner;
+ // someContainer.add(std::move(localOWner));
+ // return p;
----------------
"Owner"
================
Comment at: clang/lib/Sema/SemaInit.cpp:7077
+ // someContainer.add(std::move(localOWner));
+ // return p;
+ if (!IsTempGslOwner && pathOnlyInitializesGslPointer(Path) &&
----------------
Why is it a false positive? `std::move` left memory owned by `localOwner` in unspecified state.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64256/new/
https://reviews.llvm.org/D64256
More information about the cfe-commits
mailing list