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

    <tr>
        <th>Summary</th>
        <td>
            clang++-18/main miscompilation on windows
        </td>
    </tr>

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

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

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

<pre>
    Windows, llvm v18.1.6 or 19 from main branch.

```
clang-cl -c main.cpp -std:c++17
or
clang++ -c main.cpp -std=c++17
```
```
struct A { int v; };
struct B { int v; };

template <auto Field>
void f() {}

int main() {
    f<&A::v>();
 f<&B::v>();
}
```

```
main.cpp(5,6): error: definition with same mangled name '??$f@$0A@@@YAXXZ' as another definition
    5 | void f() {}
      |      ^
main.cpp(5,6): note: previous definition is here
1 error generated.
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8U8uOqzgQ_ZpiUwoyZcJjwSIkzS9Mz-wc44BHYCPbpDV_PzKkb-dG3Tcq-XnOcVWFI7zXg1GqgWMLx0si1jBa16jBumUdtEmutv-v-Uub3n54oDNO033Ge1alWVqgdZjVeHN2xllog1cnjBxTYBdgp8dYsEdsWzkJMxzkhAe5UVK5LHjwoQd-kkAtUJuVO9S6J8p-9Q3r8sJ6ee9l64NbZcATQtmiNgHvwFuE8gK8_Q3R_ozYx6DmZRJBIfCzWIPFTqupB_62X9-t7vEGVAHVUSoKPLGjcCzkCbCdIyLegJ-BihPwGPcouaF-JfCJaH9EfL320o3vDj8bClQdgc7FJnRC5Zx1cdGrmzY6aGvwQ4cRvZgVzsIMk-rRxA1QCbyLQfkNcgaUs1Oct_j79P7-D1CJwqMwNozKPWl-1X1EKM_4Y-Nw-0XIvji-_TF9Y4OK8-LUXdvVP5ehPY7KqZ2f7ZXioIxyIqg-felS0je8r3ktEtVkZVYWdZlnPBkbVlDRV1LyslRHduPE85pXss8FL2VBMtENMcpZwYqsylhGac_pymomZVZWWSEJcqZmoac0uiq1bki096tq6rw4smQSVzX5zZlEDxdQNKlrIv5wXQcPOZu0D_5LIegwqebJNIesAuo2f87aSzsvehJbH7Z_dHN2srqpGUNYfPymqAPqBh3G9ZpKOwN1Uf0xHRZn_1UyAHVbsh6o2_O9N_R_AAAA__8mQzHy">