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

    <tr>
        <th>Summary</th>
        <td>
            Compiler crashes when trying to catch a py::type_error on Windows
        </td>
    </tr>

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

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

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

<pre>
    The compiler Clang v13.0.0 craches at the linking step on Windows when trying to catch a py::type_error from pybind11 libray : 
```cpp
 try {
    auto casted_values = py::cast<std::vector<int32_t>>(values); // Here values is a py::list&.
  } catch (const py::cast_error& e) {
    throw py::type_error("this method expects integers as param");
  }
```
The error is : 
```
LLVM ERROR: Associative COMDAT symbol '??0builtin_exception@pybind11@@QEAA@PEBD@Z' does not exist.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
```
_(Sorry I don't have the backtrace anymore)_
The strange thing is that if I recompile the same code but keep the CMake cache, it works. ðŸ¤” 

I have already reported the error in the Pybind11 GitHub, for more information : https://github.com/pybind/pybind11/issues/3746 
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVVNtu2zAM_Rr5hZjh2E7cPPgh17VAi3ZtsQF7CSSbibXYkiHJSbOvH2UnvQzFgAVEZInS0eEhKaHLU_5cIRS6aWWNBhY1Vzs4jJIwCiMoDC8qtMAdONpVS7WX5LYOW9AKfkhV6qOFY4UKnDl5n9NQcFdUwKE9sWRG5k4tbtAYbWBrdEPrgg6ORoQnDD8BbQEWLVk0Y5NosKJthxUPCyybn2f0411_BXEoNwded0SPJcvXy7yHJQvrymF-wMJpQytSuSTekG_lLb4azrJ4ypI5sHhNBtdoEM6g0r4LoZaEGk_CCw2WLc9hElKhlXUfCAzR0gFAuuAjf1cZffxEGwJicewqurdBV-kS8KUl8sREOdyhIT4WWm54Q_sG3u_o_CXgMPWpHYSX9jOZh-nt7fc7WD0-3j_6LTNrdSG5kweExf3dcvYM9tQIXVOoGUvWZJHoZO2k2uBLga2TWrE0umSVPsm-rWYzGh5W8yUNP-kolJpUVdpRXKTmWcqH29XsaQW2E410JLjodmCw1cb5Sqqca60Xqk8P-WxY14cm1Gbn08VVSeIUdVdiX59UrrYCwYu9o8LF8NNoNyT0kzZUVjdESREzBxU_DAivZwn71Gjj07d509KST-38Vl_qpKmrqDXklqAMnnuox7G88U1FvETnYI_UL355ccf3tO6bisULoIiP2uxtCGwdsemazVI2TS9J6v9vBm68NsjL01kaLHu0c2ZVP3m4NNVX6a474eG35PUx0Bb6bLhPVF8FH2XdSVd1IiT6NBmy-PpB6YzX0tq-U9ZJlk4gKPOknCZTHjjpaswXl6ejVx__5zV4e0KCztT5P2j5rJ-HL63Rv6gv3hMbp9EkCqpcYFpu-RSvRCm2Ip6IyfQq5VGGnHZEWRzUXGBtczaeUw8pPEIP4ftpvAxkHkext3Q0ibJkGo6ybYrjeDLGjGfiqqRKxobL-rUIA5P3lHxlktO_Em8VGnBr5U4h9tcRPr1clTb5HXdUP9jRY6OogvF30JPI-yD-ANwjwbg">