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



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to