<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - clang-cl crash when compiling googletest in optimized mode (works with -O0)"
   href="https://bugs.llvm.org/show_bug.cgi?id=36161">36161</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang-cl crash when compiling googletest in optimized mode (works with -O0)
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>loorongjie@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Details of clang 7.0.0 (master):

Built with VS 2017 15.5
LLVM git hash: 8040eab58948470e391cf39ad04e86c3f755260f
clang git hash: da170fedbf6f338cdda33c09260d45895de0e069

CMake custom args:
 - -DCMAKE_C_FLAGS=/Gy /Gw /GS-
 - -DCMAKE_CXX_FLAGS=/Gy /Gw /GS-
 - -DCMAKE_EXE_LINKER_FLAGS=/OPT:REF /OPT:ICF
 - -DCMAKE_SHARED_LINKER_FLAGS=/OPT:REF /OPT:ICF
 - -DCMAKE_MODULE_LINKER_FLAGS=/OPT:REF /OPT:ICF
 - -DLLVM_TARGETS_TO_BUILD=X86
 - -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly

Reproduce steps:

git clone --depth 1 <a href="https://github.com/google/googletest">https://github.com/google/googletest</a>
cd googletest
mkdir build & cd build
cmake .. -GNinja -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl
-DCMAKE_BUILD_TYPE=Release "-DCMAKE_CXX_FLAGS=/D_CRT_SECURE_NO_WARNINGS
/D_CRT_NONSTDC_NO_WARNINGS"
ninja -j1

Result:
clang-cl crash when compiling gtest-all.cc

Crash dump, preprocessed file and command is at
<a href="https://drive.google.com/file/d/1j9hJzwmh50kX5n5P7fbW49SjnMDvPaUw/view?usp=sharing">https://drive.google.com/file/d/1j9hJzwmh50kX5n5P7fbW49SjnMDvPaUw/view?usp=sharing</a>
(Bugzilla restricts attachment to be < 1000KB).</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>