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

    <tr>
        <th>Summary</th>
        <td>
            [flang] build failure
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            flang
      </td>
    </tr>

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

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

<pre>
    command
```
cmake -S llvm -B build -DCMAKE_TOOLCHAIN_FILE=F:/Scoop/apps/vcpkg/current/scripts/buildsystems/vcpkg.cmake -DLLVM_ENABLE_PROJECTS="clang;flang" -DCMAKE_BUILD_TYPE=MinSizeRel -G Ninja -DCMAKE_C_COMPILER=clang-cl -DCMAKE_C_COMPILER_TARGET=x86_64-pc-windows-msvc -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_CXX_COMPILER_TARGET=x86_64-pc-windows-msvc -DCMAKE_INSTALL_PREFIX="H:/llvm-project-llvmorg-19.1.5/install" -DLLVM_ENABLE_LLD=on -DLLVM_TARGETS_TO_BUILD=all -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=all 
```
[cmakeerr.txt](https://github.com/user-attachments/files/18080586/cmakeerr.txt)
[cmakeout.txt](https://github.com/user-attachments/files/18080595/cmakeout.txt)
[ninjaout.txt](https://github.com/user-attachments/files/18080643/ninjaout.txt)
```
FAILED: tools/flang/lib/Parser/CMakeFiles/FortranParser.dir/parse-tree.cpp.obj 
D:\llvm\bin\clang-cl.exe --target=x86_64-pc-windows-msvc  /nologo -TP -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -IH:\llvm-project-llvmorg-19.1.5\build\tools\flang\lib\Parser -IH:\llvm-project-llvmorg-19.1.5\flang\lib\Parser -IH:\llvm-project-llvmorg-19.1.5\flang\include -IH:\llvm-project-llvmorg-19.1.5\build\tools\flang\include -IH:\llvm-project-llvmorg-19.1.5\build\include -IH:\llvm-project-llvmorg-19.1.5\llvm\include -imsvcH:\llvm-project-llvmorg-19.1.5\llvm\..\mlir\include -imsvcH:\llvm-project-llvmorg-19.1.5\build\tools\mlir\include -imsvcH:\llvm-project-llvmorg-19.1.5\build\tools\clang\include -imsvcH:\llvm-project-llvmorg-19.1.5\llvm\..\clang\include -imsvcF:\Scoop\apps\vcpkg\current\installed\x64-windows\include /DWIN32 /D_WINDOWS   /Zc:inline /Zc:__cplusplus /Oi /Brepro /bigobj /permissive- -Werror=unguarded-availability-new /W4  -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported /Gw -Wno-deprecated-copy -Wno-string-conversion -Wno-ctad-maybe-unsupported /O1 /Ob1 /DNDEBUG -std:c++17 -MD  /EHs-c- /GR- /showIncludes /Fotools\flang\lib\Parser\CMakeFiles\FortranParser.dir\parse-tree.cpp.obj /Fdtools\flang\lib\Parser\CMakeFiles\FortranParser.dir\FortranParser.pdb -c -- H:\llvm-project-llvmorg-19.1.5\flang\lib\Parser\parse-tree.cpp
In file included from H:\llvm-project-llvmorg-19.1.5\flang\lib\Parser\parse-tree.cpp:9:
H:\llvm-project-llvmorg-19.1.5\flang\include\flang/Parser/parse-tree.h(604,3): error: no matching constructor for initialization of 'std::variant<DefinedOpName, IntrinsicOperator>'
  604 | UNION_CLASS_BOILERPLATE(DefinedOperator);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
H:\llvm-project-llvmorg-19.1.5\flang\include\flang/Parser/parse-tree.h(103,22): note: expanded from macro 'UNION_CLASS_BOILERPLATE'
  103 |   classname(A &&x) : u(std::move(x)) {} \
      |                      ^ ~~~~~~~~~~~~
D:\VisualStudio\VC\Tools\MSVC\14.42.34433\include\variant(351,11): note: in instantiation of function template specialization 'Fortran::parser::DefinedOperator::DefinedOperator<std::variant<std::optional<Fortran::parser::GenericSpec>, Fortran::parser::Abstract>, void>' requested here
  351 |         : _Head(static_cast<_Types&&>(_Args)...) {} // initialize _Head with _Args...
 | ^
D:\VisualStudio\VC\Tools\MSVC\14.42.34433\include\optional(82,11): note: in instantiation of function template specialization 'Fortran::parser::GenericSpec::GenericSpec<std::variant<std::optional<Fortran::parser::GenericSpec>, Fortran::parser::Abstract>, void>' requested here
   82 |         : _Value(_STD forward<_Types>(_Args)...), _Has_value{true} {} // initialize contained value with _Args...
      | ^
D:\VisualStudio\VC\Tools\MSVC\14.42.34433\include\variant(923,7): note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'remove_reference_t<variant<optional<GenericSpec>, Abstract> &>' (aka 'std::variant<std::optional<Fortran::parser::GenericSpec>, Fortran::parser::Abstract>') to 'const variant<DefinedOpName, IntrinsicOperator>' for 1st argument
  923 | class variant : private _SMF_control<_Variant_destroy_layer<_Types...>, _Types...> { // discriminated union
      | ^~~~~~~
D:\VisualStudio\VC\Tools\MSVC\14.42.34433\include\variant(923,7): note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'remove_reference_t<variant<optional<GenericSpec>, Abstract> &>' (aka 'std::variant<std::optional<Fortran::parser::GenericSpec>, Fortran::parser::Abstract>') to 'variant<DefinedOpName, IntrinsicOperator>' for 1st argument
  923 | class variant : private _SMF_control<_Variant_destroy_layer<_Types...>, _Types...> { // discriminated union
      | ^~~~~~~
D:\VisualStudio\VC\Tools\MSVC\14.42.34433\include\variant(943,15): note: candidate template ignored: substitution failure [with _Ty = remove_reference_t<variant<optional<GenericSpec>, Abstract> &>]: no type named 'type' in 'std::_Variant_init_helper<void, std::variant<std::optional<Fortran::parser::GenericSpec>, Fortran::parser::Abstract>, Fortran::parser::DefinedOpName, Fortran::parser::DefinedOperator::IntrinsicOperator>'
  907 |     constexpr variant(_Ty&& _Obj) noexcept(is_nothrow_constructible_v<_Variant_init_type<_Ty, _Types...>, _Ty>)
      | ^
D:\VisualStudio\VC\Tools\MSVC\14.42.34433\include\variant(950,24): note: candidate template ignored: could not match 'in_place_type_t' against 'variant'
  950 |     constexpr explicit variant(in_place_type_t<_Ty>, _UTypes&&... _Args) noexcept(
      | ^
D:\VisualStudio\VC\Tools\MSVC\14.42.34433\include\variant(966,24): note: candidate template ignored: could not match 'in_place_index_t' against 'variant'
  966 |     constexpr explicit variant(in_place_index_t<_Idx>, _UTypes&&... _Args) noexcept(
      | ^
D:\VisualStudio\VC\Tools\MSVC\14.42.34433\include\variant(933,15): note: candidate constructor template not viable: requires 0 arguments, but 1 was provided
  933 |     constexpr variant() noexcept(is_nothrow_default_constructible_v<_First>)
      | ^
D:\VisualStudio\VC\Tools\MSVC\14.42.34433\include\variant(958,24): note: candidate constructor template not viable: requires at least 2 arguments, but 1 was provided
  958 |     constexpr explicit variant(in_place_type_t<_Ty>, initializer_list<_Elem> _Ilist, _UTypes&&... _Args) noexcept(
      |                        ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:\VisualStudio\VC\Tools\MSVC\14.42.34433\include\variant(973,24): note: candidate constructor template not viable: requires at least 2 arguments, but 1 was provided
  973 |     constexpr explicit variant(in_place_index_t<_Idx>, initializer_list<_Elem> _Ilist, _UTypes&&... _Args) noexcept(
      |                        ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWtty4rjWfhrlRmXKljGHi1wYHxL_P4EUkE7vfeMStgB1C8kjySSZi_3suyQDcRLo6XRnZnpXjas7YB2Wlr71rYOMsVJ0zQm5BMEIBPEFrvVGyMvfNwV37XWxFOXTZSG2W8xL4Iag5-7_uWGxxV8JdOaQsd0WOiO4rCkroRNHN-H_J_liOh1H12E2ydNsnAA_ToEfApTOCyEqgFJcVQqgdFdUX9cApUUtJeEaoFQVklba9FmB6klpsj0O7eyXjcfjTzd5MglH4yS_nU3_L4kWc-DHAKGCYb4G_mhlPxE6qjS6y8ZxvvjXrVHnhvI5_Z3MCIPOFZxQ_gUfB0Z5NL25zcbJDPixFecU7ERvvghnV8kC-PHjoJf3uk5VOA-Ul-JBOVu1K56nfP78bZGt_u8Wmk3mi3A8zm9nSZp9bvZ-3YBsTOJUUnwhhXbMjZBrxxt2vE4AUEq50pixBpo2juNxDPxY8ENzo8k8X0wb7IAfY8aOkz7fJrPsJpkswvG5oa84A4KRtR-RsqMfNQhigAYbrSvV6A1QuqZ6Uy87hdgClNaKSAdrjYvNlnBLihVlxHx6A3fgBoOe4U5bJBq21hG1_ph1hsFhnYPIwzrcMOej1ul1fYDSFyKbdVoYpmE2TmLgh1ALwayIhugpo0uA0lssFZEApdEN_krSvfhUSC0xbzo7JTUDKnPjaElIp6iqjlh-MfYyokEQGdaAIFpSDoLoQNgOeSTQcTSWa6LPMxSaTQgm1gI6i1voxOk4nFzl2SQa38VJvkjm1le9Y884WyzGSZ5M4iyc7HuuzLD8Opzns8UiA37sQie-m2TRNE6gE-fRbJFPppP5Io7yyTSPk9tZEoWLU3334WySTa7mh655Et3NkpOznrvak4wWyecouV1k08l8r0s-j8bnRL3saotq7SC3-kVGz3CyyG_CaDadP3ek09lN-LZ5nN1kz63Z9bO5znl8ENlICoKoYUwQNYwJIsOYIGpI8b2yPmIu5QWrS_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