This adds an error if variable with incomplete type has initializer with
incomplete type, so it is not possible to deduce array size from
initializer.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/lib/Sema/SemaDecl.cpp | ||
---|---|---|
13456 | Not sure about the error message though, maybe it makes sense to add a message similar to err_new_array_size_unknown_from_init . |
Comment Actions
LGTM with a small nit
clang/lib/Sema/SemaDecl.cpp | ||
---|---|---|
13449–13462 | We can cram everything into one predicate; but this is largely intended to rearrange the logic so we're checking the cheap conditions before trying to call getAsIncompleteArrayType twice. |
Comment Actions
The failures in CI are unrelated and caused by another patch - https://reviews.llvm.org/D112921.
Not sure about the error message though, maybe it makes sense to add a message similar to err_new_array_size_unknown_from_init .