Issue 76216
Summary [MSVC][std:c++latest] LLVM failed to build due to error C2027: use of undefined type 'clang::SyntaxOnlyAction' when add option /std:c++latest
Labels clang
Assignees
Reporter Zhaojun-Liu
    Hi All,
Recently, I updated the commit of LLVM, it built failed due to below errors when add option /std:c++latest, could you take a look this issue? Thanks.
```
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.38.33130\include\memory(3138,27): error C2027: use of undefined type 'clang::SyntaxOnlyAction' [F:\gitP\llvm\llvm-project\build_amd64\tools\clang\tools\clang-fuzzer\handle-cxx\obj.clangHandleCXX.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.38.33130\include\memory(3138,25): error C2338: static_assert failed: 'can't delete an incomplete type' [F:\gitP\llvm\llvm-project\build_amd64\tools\clang\tools\clang-fuzzer\handle-cxx\obj.clangHandleCXX.vcxproj]
```

**Repro steps:**
1. git clone https://github.com/llvm/llvm-project F:\gitP\llvm\llvm-project
2. git -C "F:\gitP\llvm\llvm-project" reset --hard 4d1cd38
3. set \_CL_= /std:c++latest
4. mkdir F:\gitP\llvm\llvm-project\build_amd64 & cd F:\gitP\llvm\llvm-project\build_amd64
5. cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_SYSTEM_VERSION=10.0.22621.0 -DLLVM_ENABLE_PROJECTS="clang" ..\llvm 
6. set \_CL_=/D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR /D_HAS_AUTO_PT_ETC=1 /D_HAS_TR1_NAMESPACE=1 /wd4996 /D_HAS_DEPRECATED_RESULT_OF=1 /D_SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING /Zc:char8_t- /Zc:rewrittenExpressions-
7. msbuild /maxcpucount:4 /p:Platform=x64 /p:Configuration=RelWithDebInfo /p:PreferredToolArchitecture=x64 LLVM.sln /t:Rebuild 

**Detailed log:** 
[LLVM_build.log](https://github.com/llvm/llvm-project/files/13749918/LLVM_build.log)

**Note:**
I tried to add `#include "clang/Frontend/FrontendActions.h"` to one of the cpp files reporting errors, the cpp file would build pass.

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to