`xu.p.data[i] = default(T)` doesnt produce any cgen code in `importcpp` types
              > Minimum C++ code that causes compile error "flexible array member 'foos' of type 'Foo[]' with non-trivial destruction":
> 
> ```c++
> #include <cstdlib>
> #include <iostream>
> 
> struct Foo {
>   ~Foo() {
>     std::cout << "Destory foo\n";
>   }
> };
> 
> struct Bar {
>   size_t len;
>   Foo foos[];
> };
> 
> int main() {
>   Bar* b = (Bar*)malloc(sizeof(Bar) + sizeof(Foo));
>   free(b);
> 
>   return 0;
> }
> ```
> 
> https://godbolt.org/z/xcczKq58n
> 
> Changing `Foo foos[];` in `struct Bar` to `Foo foos[1]` fixes the compile error. But as `Bar` is allocated with `malloc` function and freed with `free` function, the destructor of `Foo` is not called. It seems when using a flexible array member or a fixed sized array members as FAM, both constructors and destructors are not automatically called.
> 
> Following code creates a sequence of imported C++ struct with the constructor and the destructor, but both the constructor and the destructor are not called.
> 
> foo.hpp:
> 
> ```c++
> #include <iostream>
> 
> struct Foo {
>   Foo(): x(-1) {
>     std::cout << "Ctor Foo\n";
>   }
> 
>   ~Foo() {
>     std::cout << "Destory Foo(" << x << ")\n";
>   }
> 
>   void print() {
>     std::cout << "Foo.x = " << x << '\n';
>   }
> 
>   int x;
> };
> ```
> 
> testcpp.nim:
> 
> ```nim
> type
>   Foo {.importc, header: "foo.hpp".} = object
>     x: cint
> 
> proc print(f: Foo) {.importcpp, header: "foo.hpp".}
> 
> proc test =
>   var f = newSeq[Foo](3)
>   f[0].x = 1
>   f[1].x = 2
>   for i in 0 ..< f.len:
>     f[i].print
> 
> test()
> ```
> 
> Output:
> 
> ```
> Foo.x = 1
> Foo.x = 2
> Foo.x = 0
> ```
> 
> No output from `Foo::Foo()` and `Foo::~Foo()`.

This is a separated -unrelated- issue, the line `xu.p.data[i] = default(T)` generated by `newSeq[Foo](3)` is **not** producing any code for the `importcpp` type.

_Originally posted by @jmgomez in https://github.com/nim-lang/Nim/issues/23913#issuecomment-2291394709_
            