Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/lib/AST/Interp/ByteCodeExprGen.cpp | ||
---|---|---|
950–951 | This should go through ASTContext::getConstantArrayType(). It may also be worth a comment mentioning that VLAs can't have initializers and an unbounded array has known bounds if it has an initializer, as I suspect that's the reason you're not handling either of those here? | |
clang/test/AST/Interp/arrays.cpp | ||
188–200 | I'd like to see a test for when the class ends with a flexible array member (ctor shouldn't be called for that case because we don't know how many trailing objects there will be). That could show up as an unbounded member. Also, a test case where the ctor will execute UB, to demonstrate we properly diagnose arrays of default-constructed objects. |
clang/lib/AST/Interp/ByteCodeExprGen.cpp | ||
---|---|---|
950–951 | I'm not handling them because they are untested everywhere. :/ | |
clang/test/AST/Interp/arrays.cpp | ||
188–200 | I added a test for a UB constructor, but a flexible array member shows up as a non-ConstantArrayType member, so the code runs into one or the other assertion. |
This should go through ASTContext::getConstantArrayType(). It may also be worth a comment mentioning that VLAs can't have initializers and an unbounded array has known bounds if it has an initializer, as I suspect that's the reason you're not handling either of those here?