[PATCH] D135013: [clang][Interp] Array initialization via ImplicitValueInitExpr

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 20 07:26:49 PDT 2022


aaron.ballman added a comment.

In D135013#3871250 <https://reviews.llvm.org/D135013#3871250>, @tbaeder wrote:

> In D135013#3871209 <https://reviews.llvm.org/D135013#3871209>, @aaron.ballman wrote:
>
>> In D135013#3870894 <https://reviews.llvm.org/D135013#3870894>, @tbaeder wrote:
>>
>>> @aaron.ballman Do you maybe have a different reproducer or know more about the expected behavior of a `ImplicitValueInitExpr` for array and record types?
>>
>> So here's another reproducer with a record type: https://godbolt.org/z/EhT4oqT3s and here's one with an array type: https://godbolt.org/z/Pbncnq418
>>
>> My understanding of `ImplicitValueInitExpr` is that it's used to represent some of the "holes" in the middle of an array/record that need to implicit get some values.
>
> They are //inside// a struct or array, but not of array or struct type, if I understand correctly. But I see what you're getting at, I guess this should basically go through `visitZeroInitializer()` (which is currently unused), which should be extended to handle structs and arrays.

Ah, yes! That's true, they are inside the struct or array. I'm not certain you can have one *of* struct type in C++ because it's either going to be zeroed or left uninitialized (due to constructors).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135013/new/

https://reviews.llvm.org/D135013



More information about the cfe-commits mailing list