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

    <tr>
        <th>Summary</th>
        <td>
            Wrong/missing debuginfo for struct with default constructor and nested struct declaration
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          m-mueller678
      </td>
    </tr>
</table>

<pre>
    ```
#include<cstdlib>

struct A  {
 int x;

    A(){};

    struct Inner {
        int inner_inner = 0;
    };

    Inner inner;  // exclusive
};

int main(){
    A* a=reinterpret_cast<A*>(malloc(sizeof(A)));
 a->x=0;
}
```
Compiling this with clang and debugging with either gdb or lldb, A is reported as incomplete type or as 'no such type' depending on situation.
`clang++-17 sample.cpp -g -std=c++20 && gdb a.out -ex 'ptype A'`
```
GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
 <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from a.out...
No symbol "A" in current context.
(gdb) 
```

If the constructor is removed, it works as expected.

tested with both of these:
```
Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
```
```
Ubuntu clang version 15.0.7
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
```


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.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