<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/61010>61010</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Mismatch with MSVC name mangling handling when dealing with the address of a union member as an auto template argument
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
CasualPokePlayer
</td>
</tr>
</table>
<pre>
When using clang under an msvc target, it uses the same mangled name for the address of different members of a union.
The expected (matching MSVC) behavior is that the type of the member should add onto the mangled name, thereby avoiding a name mangling clash. A minimal repro of this issue can be found here: https://godbolt.org/z/hE5dsT4oE
Additionally, it would appear even when the type is the same, and such there is a name mangling clash, MSVC is able to reconcile the issue by merging the calls into the same mangled function. This I suppose is not as important as the former (the chances of this are unlikely to affect programs in practice), but still a mismatch with MSVC behavior. A minimal repro of this issue can be found here: https://godbolt.org/z/dTcxj8Pnc
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0VMuu4zYM_Rp5Q0zgyHESL7xI70yALga4QIN2TUu0pRk9DD2SSb--kJ37bLfdJKLExzmHpDFGPTminrW_sfZrhTkpH_onjBnNs_9JzwbvFKrBy3v_lyIHOWo3gTDoJshOUgB0YONVQMIwUWL8CXSCHClCUgQRLYFFNxmS4Iox-rC8oJSBYgQ_gtTjSIFcAkt2oLBcImSnvduw-iurT-vvRRHQr5lEIgmMHy0moQqg73_8-cR4BwMpvGofQJfymJZK6T5TyVjOawGIymcjCwbwLvn16R3KQiMpCjTcAa9ey1IEVwKL30OFqDZwAqudtmgg0Bz8WklH0DFmAoEOhsI6OwklI2tOoFKaI2tOjJ8ZP09eDt6kjQ8T4-e_GT-rb62Ml53_9p78SUqdtHdozP0h821lMc-EAehKDm6lSa-k9VsTSgQ6CTELtVIrr_9JqbgWQReHwRAkD4GEd0IXQ9GD2nAHS2EqceVSoDER9IucHzo_ZicK9g1cijS_Q8zz7OOCwfkEGEHb2YeEbjFKgtEHS6G0ecmu0AmKr-piIMjO6J9k7gUgjiOJBHPwU0BbcMAcUCQtiPGuUBpygpi0MYBgdVxmB246qZXsy-j8Lw2VF_Hrx_HZiUr2jeyaDivqt_vDYbdruq6uVL_vsDuM-327PXDads1Y7_mxpXonDnWLA690z2ve1Jzved10bb2hwyCOom3bbteI5ijYriaL2myMudpSu1oA9_ttva0rgwOZuCw6545uKxvGedn70JeYL0OeItvVRscU37IknQz13_-t2MfRUejkclhGUBKuRvH-tO6PzX7ZRYzlG4K5zA3Z2WAiwDBlSy5VOZj-k7g6qTxshLeMnwvIx9-XOfgfJBLj54VaZPy8UP8nAAD__6qcrZo">