================
@@ -5753,3 +5753,23 @@ StringRef PredefinedSugarType::getName(Kind KD) {
}
llvm_unreachable("unexpected kind");
}
+
+bool Type::isSpanLikeType() const {
----------------
AaronBallman wrote:
I'm rather worried about this as a heuristic on `Type`. Consider:
```
struct Person {
const char *Name;
int Age;
};
struct Record {
void *allocator_function;
int reserved;
};
```
and so on. There are far too many reasons for a type to have a pointer and an
integer that have nothing to do with being span-like.
I think this logic should be sunk into SemaDeclAttr.cpp to make it clear this
is only valuable for the attributes in question, and should probably have a
comment about false positives being expected.
https://github.com/llvm/llvm-project/pull/165433
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits