<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/57700>57700</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Compilation error for incomplete vector type with clang-15
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          hudihuda
      </td>
    </tr>
</table>

<pre>
    The following code compiles fine with gcc-10.2, clang-14 (stdlibc++ and libc++) and with clang-15 stdlibc++. clang-15 with libc++ throws an error: arithmetic on a pointer to an incomplete type 'B'. All tests with --std=c++20.

```
#include <iostream>
#include <vector>

struct B;

struct A {
        A(std::vector<B> b) : m_(b){}
        std::vector<B> m_;
};

struct B {
        std::vector<A> m_;
};

int main() {
    std::cout << "main..." << std::endl;
}


```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyFUsuuozAM_ZqwsYpCgNIsWNDHfMHsR4G4kFFKqiTc6v79GPrWdDTIhPh1fLDdOv1d_xwQjs5adzFjD53TSMfpbCwGOJoR4WLiAH3XrTKeCiZ20Fk19qusACY2IWpr2o6JLQmoUcNTZUIulgXgllTCW0b6tC9RL1hx8O4SCADQe-dZ3oDyFHPCaDpwIyg4OzNG9BDdHGbGmbfFiBC_z0jsKgKqUmishYghhmuN1YoosHx_KyR4yvie8eZ2rvlNrqrICddO1BWW74wL0aM6sfzwyf2FXZyZHl4BKWPqImxZvv1gboBVD7tsrh2lfyW5o-0o9QDt3M25CadfFDRrc2K1f-T-I4_CH4Up-iOJ7RuJv4Ga_wLRHOCkzEjUFp53OKDngde5Kc5tIqHhiDk-TVO63Y2PSBy1fav2OqD3MSVYZ-u1kFKWRZboOtcylyqJJlqsd8siq2jcbYto0_3rolx_8bovb2uaTN7WQ4znMDMSP0h68k9tSrmkWPt1_6zO3v0mHFJNCBMGupRVxXky1BUvpd4UJT9mZSW77FhkvOVa5dlGS65lYlWLNtSspFUUI15ggaA7K_eJqQUXgstMZOtM8iztylbh5lhIVQrU5YYVHKmNNp15pM73ia8XSu3UB3JaQ1v_dKoQTD8iLuUIX01xcL4eJm3oVclSu164_wGEbDIo">