[PATCH] D76084: [Sema][SVE] Reject subscripts on pointers to sizeless types
Eli Friedman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 16 11:28:11 PDT 2020
efriedma added a comment.
We already support sizeof expressions where the result can't be computed at compile-time. For example: `int f(int n, int (*p)[n]) { return sizeof(*p); }`. (For constant contexts specifically, see HandleSizeof() in ExprConstant.cpp.) I think any argument that it would be hard to extend that to cover sizeless types is pretty weak.
Of course, just because we can support it doesn't mean we should. As a matter of language design, we might want to discourage users from writing that sort of thing. It could be argued either way.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D76084/new/
https://reviews.llvm.org/D76084
More information about the cfe-commits
mailing list