================
@@ -249,9 +254,10 @@ static void
visitLocalsRetainedByReferenceBinding(IndirectLocalPath &Path,
LocalVisitor Visit);
template <typename T> static bool isRecordWithAttr(QualType Type) {
- if (auto *RD = Type->getAsCXXRecordDecl())
- return RD->hasAttr<T>();
- return false;
+ CXXRecordDecl *RD = Type.getNonReferenceType()->getAsCXXRecordDecl();
----------------
usx95 wrote:
I do not think there is a difference in the annotations in that respect.
For example, consider:
```cpp
std::string_view foo(std::string_view&& t [[clang::lifetimebound]]);
void use() {
std::string_view x = foo(std::string_view()); // Clangs warns here.
}
```
I think this is, in principle, a false positive. Pointer-like types when
appearing as a reference type should be considered values.
https://github.com/llvm/llvm-project/issues/116066
https://github.com/llvm/llvm-project/pull/115921
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits