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

    <tr>
        <th>Summary</th>
        <td>
            new (align_val_t(...)) when launched clang from Microsoft Visual Studio 2022
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

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

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

<pre>
    clang version 17.0.6 - installed by online installer Microsoft Visual Studio

If the code:
```C++
int main()
{
        size_t n = 5;
        double* Test = new(std::align_val_t(64)) double[n];
        delete[] Test;
        return 0;
};
```
compiled from the command line: ```clang main.cpp -std=c++17```, that code works.

But if you run it from Microsoft Visual Studio with the _clang_ compiler selected in its settings, an exception occurs on the ```delete[]``` operator:
"Unhandled exception at address 0x00007FF91976F439 (ntdll.dll) in Tests.exe: 0xC0000374: Heap was corrupted (parameters: 0x00007FF9197D97F0)."

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8U82OszgQfBpzaQ0yBgIcOEwmQruHPe3PNXLsJnjX2Mg_k8w-_crAl2QO-0kWyN10dXV1wb1XV4PYk_pI6lPGY5is629zdLfsYuVXLzQ3V_hE55U1UDQ5zQ_wBsr4wLVGCZcvsEYrg4-Yg9-UcNbbMcBfykeu4fcQpbKEngh9356_jhAmBGElknKPkQPdzgdhx3TWqDIBZq4MYS1h3f5lc_wB1nn1L54DGCDlCWpSPjPSxotGwt7hD_RhzRu8Edb6IFPT8p1rdTXnT67PgbD2UKUGrIO9sD4aUp--IaLGgJtYK-hr0mGIzgB9xpqX4h-zbVdh50Ul-UZn512JeeZGQpKSlO_wKNg2kBTIxbLA20r-JDaJiuYJzD4gTDysmsLNun98_qr4MQZQI3zZCC4aUGHr_T-7gpsK00rsvBI4w07ZgUeNIqAElVA8eAxBmatPBLgBvAtcQnKLFSI6D9asOA-iryI-gmAXdDxY93QDY3-aiRuZZHqC8gBcSofeA71TSmkzDF3RNYehKjsgrDVBap1LrdMmlVnX5HO8r6rS-0eqKZsq3X5BvsCNexDWubikmQhrF-74jAGd3ypempy6ZqCEdTlhbGOZyb6UXdnxDPuiYWVDWXXosqmv6KVo-SiLcSxFV2F96JqiLMa2kaJgTZepnlFW0bao6aGoWJePzaHheKmxwrJF0ZCK4syVzrX-nHPrrpnyPmJf0Kqidab5BbVf_1zG1h0lUvUpc30qeLvEqycV1SqN_4AIKmjsDd7SpN_tn-f57v_bhAY0j0ZMKGEz4E_NwihjWXS6n0JYkmyEDYQNVxWmeMmFnQkbEoX99bY4-zeKQNiwjuQJG_apPnv2XwAAAP__V9ljZw">