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

    <tr>
        <th>Summary</th>
        <td>
            llvm/Analysis/AliasAnalysis.h does not build in C++23 mode
        </td>
    </tr>

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

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

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

<pre>
    Repro: (clang / llvm 18.1.8 as provided by Arch Linux)

foo.cpp:
```cpp
#include <llvm/LinkAllPasses.h>
```

```bash
$ clang++ -std=c++20 -c foo.cpp
(ok)

$ g++ -std=c++20 -c foo.cpp
(ok)

$ g++ -std=c++23 -c foo.cpp
(ok)

$ clang++ -std=c++23 -c foo.cpp
In file included from foo.cpp:2:
In file included from /usr/include/llvm/LinkAllPasses.h:17:
In file included from /usr/include/llvm/ADT/Statistic.h:32:
In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.2.1/../../../../include/c++/14.2.1/memory:78:
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.2.1/../../../../include/c++/14.2.1/bits/unique_ptr.h:91:16: error: invalid application of 'sizeof' to an incomplete type 'llvm::AAResults::Concept'
   91 | static_assert(sizeof(_Tp)>0,
      | ^~~~~~~~~~~
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.2.1/../../../../include/c++/14.2.1/bits/unique_ptr.h:398:4: note: in instantiation of member function 'std::default_delete<llvm::AAResults::Concept>::operator()' requested here
  398 |           get_deleter()(std::move(__ptr));
      | ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.2.1/../../../../include/c++/14.2.1/bits/stl_construct.h:88:15: note: in instantiation of member function 'std::unique_ptr<llvm::AAResults::Concept>::~unique_ptr' requested here
 88 |         __location->~_Tp();
      | ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.2.1/../../../../include/c++/14.2.1/bits/stl_construct.h:149:12: note: in instantiation of function template specialization 'std::destroy_at<std::unique_ptr<llvm::AAResults::Concept>>' requested here
  149 |       std::destroy_at(__pointer);
      | ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.2.1/../../../../include/c++/14.2.1/bits/stl_construct.h:163:11: note: in instantiation of function template specialization 'std::_Destroy<std::unique_ptr<llvm::AAResults::Concept>>' requested here
 163 |             std::_Destroy(std::__addressof(*__first));
      | ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.2.1/../../../../include/c++/14.2.1/bits/stl_construct.h:193:35: note: in instantiation of function template specialization 'std::_Destroy_aux<false>::__destroy<std::unique_ptr<llvm::AAResults::Concept> *>' requested here
  193 |         return std::_Destroy_aux<false>::__destroy(__first, __last);
      | ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.2.1/../../../../include/c++/14.2.1/bits/alloc_traits.h:944:12: note: in instantiation of function template specialization 'std::_Destroy<std::unique_ptr<llvm::AAResults::Concept> *>' requested here
  944 |       std::_Destroy(__first, __last);
      | ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.2.1/../../../../include/c++/14.2.1/bits/stl_vector.h:735:7: note: in instantiation of function template specialization 'std::_Destroy<std::unique_ptr<llvm::AAResults::Concept> *, std::unique_ptr<llvm::AAResults::Concept>>' requested here
  735 | std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
      | ^
/usr/include/llvm/Analysis/AliasAnalysis.h:311:3: note: in instantiation of member function 'std::vector<std::unique_ptr<llvm::AAResults::Concept>>::~vector' requested here
  311 |   AAResults(const TargetLibraryInfo &TLI) : TLI(TLI) {}
 |   ^
/usr/include/llvm/Analysis/AliasAnalysis.h:604:9: note: forward declaration of 'llvm::AAResults::Concept'
  604 |   class Concept;
 |         ^
1 error generated.
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzUmF2P2yoTxz8NuUGxbHD8cpELb7KR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