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

    <tr>
        <th>Summary</th>
        <td>
            VTable Optimizations; Invalid application of 'sizeof' to an incomplete type in DWARFLinkerCompileUnit.h
        </td>
    </tr>

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

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

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

<pre>
    similar to #55239 , I'm hitting this error when building llvm 18 with clang 18:
```
usr/lib/llvm/18/bin/clang++-18 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/var/tmp/portage/sys-devel/llvm-18.
1.8/work/llvm_build-abi_x86_64.amd64/lib/DWARFLinker/Parallel -I/var/tmp/portage/sys-devel/llvm-18.1.8/work/llvm/lib/DWARFLinker/Parallel -I/var/tmp/port
age/sys-devel/llvm-18.1.8/work/llvm_build-abi_x86_64.amd64/include -I/var/tmp/portage/sys-devel/llvm-18.1.8/work/llvm/include  -DNDEBUG -march=znver2 -fl
to=thin -fwhole-program-vtables -fforce-emit-vtables -O3 -pipe -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=un
guarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-co
mpat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstri
ng-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -std=c++17 -MD -MT lib/DWARFLinke
r/Parallel/CMakeFiles/LLVMDWARFLinkerParallel.dir/SyntheticTypeNameBuilder.cpp.o -MF lib/DWARFLinker/Parallel/CMakeFiles/LLVMDWARFLinkerParallel.dir/Synt
heticTypeNameBuilder.cpp.o.d -o lib/DWARFLinker/Parallel/CMakeFiles/LLVMDWARFLinkerParallel.dir/SyntheticTypeNameBuilder.cpp.o -c /var/tmp/portage/sys-de
vel/llvm-18.1.8/work/llvm/lib/DWARFLinker/Parallel/SyntheticTypeNameBuilder.cpp
In file included from /var/tmp/portage/sys-devel/llvm-18.1.8/work/llvm/lib/DWARFLinker/Parallel/SyntheticTypeNameBuilder.cpp:9:
In file included from /var/tmp/portage/sys-devel/llvm-18.1.8/work/llvm/lib/DWARFLinker/Parallel/SyntheticTypeNameBuilder.h:12:
In file included from /var/tmp/portage/sys-devel/llvm-18.1.8/work/llvm/lib/DWARFLinker/Parallel/DWARFLinkerCompileUnit.h:12:
In file included from /var/tmp/portage/sys-devel/llvm-18.1.8/work/llvm/lib/DWARFLinker/Parallel/DWARFLinkerUnit.h:12:
In file included from /var/tmp/portage/sys-devel/llvm-18.1.8/work/llvm/lib/DWARFLinker/Parallel/DWARFLinkerGlobalData.h:12:
In file included from /var/tmp/portage/sys-devel/llvm-18.1.8/work/llvm/lib/DWARFLinker/Parallel/TypePool.h:12:
In file included from /var/tmp/portage/sys-devel/llvm-18.1.8/work/llvm/lib/DWARFLinker/Parallel/ArrayList.h:12:
In file included from /var/tmp/portage/sys-devel/llvm-18.1.8/work/llvm/include/llvm/Support/PerThreadBumpPtrAllocator.h:12:
In file included from /var/tmp/portage/sys-devel/llvm-18.1.8/work/llvm/include/llvm/Support/Allocator.h:20:
In file included from /var/tmp/portage/sys-devel/llvm-18.1.8/work/llvm/include/llvm/ADT/SmallVector.h:28:
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/memory:78:
/usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/unique_ptr.h:91:16: error: invalid application of 'sizeof' to an incomplete type 'llvm::dwarf_li
nker::parallel::DependencyTracker'
   91 | static_assert(sizeof(_Tp)>0,
      | ^~~~~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/unique_ptr.h:398:4: note: in instantiation of member function 'std::default_delete<llvm::dwarf_linker::parallel::DependencyTracker>::operator()' requested here
  398 |           get_deleter()(std::move(__ptr));
 | ^
/var/tmp/portage/sys-devel/llvm-18.1.8/work/llvm/lib/DWARFLinker/Parallel/DWARFLinkerCompileUnit.h:53:18: note: in instantiation of member function 'std::unique_ptr<llvm::dwarf_linker::parallel::DependencyTracker>::~unique_ptr' requested here
   53 | class alignas(8) CompileUnit : public DwarfUnit {
      | ^
/var/tmp/portage/sys-devel/llvm-18.1.8/work/llvm/lib/DWARFLinker/Parallel/DWARFLinkerCompileUnit.h:26:7: note: forward declaration of 'llvm::dwarf_linker::parallel::DependencyTracker'
   26 | class DependencyTracker;
      |       ^
1 error generated.

```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMWM1y27jSfRpog4JKBPVDLrSQJSvlr_yTipVoqQKJJtlfQIABQCnKYp79FkjJ1oyTyZ1JbmKVSzYBd_fpc9BAg8I5LDXAnEyuyGQ1EK2vjJ3_n9AaP_JRmg4yI49zhzUqYak3lPB4MuFxSglf0hvCZzWt0HvUJfUVOgrWGksPFWiatahkmFBqX9MooQf0Fc2V0CWNEhIvyGhFRgsyHZ1-usfWWcLXCrPwrfY14esoIXydoSZ83VkTfkX4FYsSyla7N_fvd48P798tr8PT7nGzWu6WD_ePm8X9Zne3WL57eHyeWD-8u1u8HL69ubt5Hr0hfL0XAYWvG8LXjbFelED42h0dk7AHdcLGomTYo46GAePB2I-nqV2XPRMZ7j4n0910PBS1nI6fUlttF-_Wt6g_Qgj0VlihFKh_GvxF2H_lv0_hH0T5dnKoc9VK-Bl5nF1RtrpfXV-9f0NZLWxekXj1Re_BcsoK1UP3hsQrX6GmrDhURgFrrCmtqNnei0yBo6wojM2BQY3-efAhpqzBBigr3t4sKSu0YQ5qoT3mDLUH2xiHHk1wvEeHGSr0R4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