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

    <tr>
        <th>Summary</th>
        <td>
            clang-cl: Incomplete/missing debug info for classes marked with `novtable`
        </td>
    </tr>

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

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

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

<pre>
    Classes that are marked with `__declspec(novtable)` won't have full debug info generated (only a forward declaration).

### Reproduction

**Input**:

```cpp
// novtable.cpp
class __declspec(novtable) _Ref_count_base {
    virtual void _Destroy() noexcept {};

    int _Uses = 1;
};

int main() {
 _Ref_count_base base;
    return 0;
}
```

1. Compile with `clang-cl /Zi novtable.cpp`
2. Check the generated debug info:
    ```console
    > llvm-pdbutil pretty -classes -include-types=_Ref_count novtable.pdb
 [...]
      Classes: (Showing 915 items)
        class _Ref_count_base [sizeof = 0] {}
    ```
3. Remove the `__declspec(novtable)`
4. Remove `novtable.pdb`
5. Compile with `clang-cl /Zi novtable.cpp`
6. Check the generated debug info:
    ```console
    > llvm-pdbutil pretty -classes -include-types=_Ref_count novtable.pdb
    [...]
      Classes: (Showing 915 items)
        class _Ref_count_base [sizeof = 16] {
          func [0x000071c0+ 0 - 0x000071c7- 7 | sizeof=  7] (FPO) virtual void __cdecl _Ref_count_base::_Destroy()
          vfptr +0x00 [sizeof=8]
          data +0x08 [sizeof=4] int _Uses
          <padding> (4 bytes)
        }
 [...]
    ```
---

I'd like to fix this myself.

</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzMVU-PuzYQ_TSTywhkTPiTA4dk00h7aauteuklMjAEdw1Gtslufp--MpC_UnuoVKkraxMxMy9v5r3Bwlp56okKSHaQ7FdidK02xc9k5Pflx6rU9aV4U8Jasuha4VAYwk6YT6rxS7oWIWXHY02VsgNVwPNen50oFQH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