<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/69996>69996</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Compilation errors about `unique_ptr<clang::SyntaxOnlyAction>` with clang as the host compiler
</td>
</tr>
<tr>
<th>Labels</th>
<td>
c++,
clang:frontend
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
yuanfang-chen
</td>
</tr>
</table>
<pre>
GCC works fine.
To reproduce
```
> clang++ --version
clang version 17.0.3
Target: x86_64-unknown-linux-gnu
Thread model: posix
> clang++ -Wno-gnu-line-marker -std=c++17 -fsyntax-only -x c++-cpp-output CrossTranslationUnit.cpp.ii.txt
/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/unique_ptr.h:76:16: error: invalid application of 'sizeof' to an incomplete type 'clang::SyntaxOnlyAction'
76 | static_assert(sizeof(_Tp)>0,
| ^~~~~~~~~~~
/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/unique_ptr.h:268:4: note: in instantiation of member function 'std::default_delete<clang::SyntaxOnlyAction>::operator()' requested here
268 | get_deleter()(__ptr);
| ^
/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/unique_ptr.h:233:45: note: in instantiation of member function 'std::unique_ptr<clang::SyntaxOnlyAction>::~unique_ptr' requested here
233 | constexpr unique_ptr(nullptr_t) noexcept : unique_ptr() { }
| ^
/public/home/xx/Src/aomp-git/trunk18.0/llvm-project/clang/include/clang/Frontend/ASTUnit.h:80:7: note: forward declaration of 'clang::SyntaxOnlyAction'
80 | class SyntaxOnlyAction;
| ^
1 error generated.
```
[CrossTranslationUnit.cpp.ii.txt](https://github.com/llvm/llvm-project/files/13098302/CrossTranslationUnit.cpp.ii.txt)
</pre>
<img width="1px" height="1px" alt="" src="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