<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=http://email.email.llvm.org/c/eJzlVktz2jAQ_jXyZQePkbDBBx_Io7demhx6Y4S0BnWE5ZFkSPrruzYkzRCaTEvTdCaMkCXvU9K38rd0-r66XSPUzlq3M80KLhm_oAbKaQQToHGRxpvWWNSwM3ENykrSu5sVo2IC27FIszTbSz7fAN5FbIJxTQBs5JKMGL-E3ZrMwTx6ChA6pTCEurP2fm_8dVbAJmwVuSxTll2xbH4TsQ0QHXhsvdOdQibme9G-H6egZISIIaaqbQ-iIju0YRpx01oZEZi4pNRDgMVty8Q1hOg7tTdeLLvVQnB48cemF_G-RY117wH6MRMXbHrV978bijR6GZ_DYtFG37-4_kcBFR1OPBn2jQJuHZn0AHgW801XeCrs6wH3vWkibKRpGJ8xXvZmBylpngIZTw9l8QBFGN3AqN6E0c-C-AU6D9AVc0F_XlIH6L3z_cD3mZrGRLIHVwPj02cLppfz4yMlvXcCyIsFlF-z6Zu14-3kj9tJV1h_cUDrcWtcF-DJptINt0aP71S_r-3W8Zomfw6RE9VwHkrOqer3Q8mHgkt-7o3y10Fzzs38H4DmA8FI7DETYIUNekpPp08_kEefsURXQpeilIns4tr5SnrpN6bBpPO2WsfYhp668U_UVsT2umVKVJAm1m4fHiPieN9QRZqaEDoMNMhFMR0n6wrFZKy1VLocK6lVls3GvMi0yLOa57qsEyuXaEPFciKvvMEdDC5ozPKr5PwMTMUzTi0rx5yekzTnWOdiomYzUU8LVbBJhkQYbNr7SZ1fJb4aXNLBBRJaE2L4KaRTNqsGcUiYMowmWqy-PC3OYfuJmHt4BEhoURlpzXc5aAy0WfDRkoh164iyoAeptSdeTapSISTDMqphDT8AE6Bz4A>53671</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Redefinition error for template specialization with 32-bit pointer address space
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ararmine
</td>
</tr>
</table>
<pre>
The following C++ code is not compiled with clang x86-64 v13.0.0 with MS extensions enabled, while it compiles successfully with X86 msvc v19.
Steps to reproduce:
1. cat test.cpp
```
template <class _Tp> struct test_bug_32 {typedef _Tp type;};
template <class _Tp> struct test_bug_32<_Tp* __ptr32> {typedef _Tp type;};
template <class _Tp> struct test_bug_32<_Tp* const __ptr32> {typedef _Tp type;};
template <class _Tp> struct test_bug_32<_Tp* volatile __ptr32> {typedef _Tp type;};
template <class _Tp> struct test_bug_32<_Tp* const volatile __ptr32> {typedef _Tp type;};
int main() {
}
```
2. clang test.cpp -S -fms-extensions
```
test.cpp:3:29: error: redefinition of 'test_bug_32<_Tp *const __ptr32>'
template <class _Tp> struct test_bug_32<_Tp* const __ptr32> {typedef _Tp type;};
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.cpp:2:29: note: previous definition is here
template <class _Tp> struct test_bug_32<_Tp* __ptr32> {typedef _Tp type;};
^
test.cpp:4:29: error: redefinition of 'test_bug_32<_Tp *volatile __ptr32>'
template <class _Tp> struct test_bug_32<_Tp* volatile __ptr32> {typedef _Tp type;};
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.cpp:2:29: note: previous definition is here
template <class _Tp> struct test_bug_32<_Tp* __ptr32> {typedef _Tp type;};
^
test.cpp:5:29: error: redefinition of 'test_bug_32<_Tp *const volatile __ptr32>'
template <class _Tp> struct test_bug_32<_Tp* const volatile __ptr32> {typedef _Tp type;};
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.cpp:2:29: note: previous definition is here
template <class _Tp> struct test_bug_32<_Tp* __ptr32> {typedef _Tp type;};
^
3 errors generated.
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzlVktzmzAQ_jXismMGSxjbBw7Oo7demhx68wixGHVkxEjCTvrru4CTZhw3mdZN05kwi5DYp6RvpS1seZ_f1giVNcbudbOBS8YviEDZEkF7aGyg_rbVBkvY61CDMpLk7hbZJEthNxVxEicj5_MN4F3AxmvbeMBGFqTE-CXsa1IH_WjJg--UQu-rzpj7UfnrIoOt3ykyuYxZcsWS1U3A1kOw4LB1tuwUMrEaWWM7jUHJAAF9iFXbHlhZcqBhGHDbGhkQmLik0L2H9W3LxDX44Do1Kq-LbrMWHF582Pwi3LdYYtVbgL7PxAWbX_Xt77oiiZ7HV7Bet8H1P67_kUNFmxNOun0jhztLKj0Anvl80xmecvu6w7HVTYCt1A3jC8aXvdqBS5KnQMbjQ1o8QBEmNzCptn7yMyF-gc4DdMVK0MuX1AA6Z13fcX2kutGB9MFWwPj82YTp5-p4S0nunQDyYgLNrtn8zeh4OfnjctIR1h8c0Drcadt5eLKodMLV6PCd8ve11TqeU_rnEDmRDeeh5Jysfj-UfCi4zM49Uf46aM45mf8D0HwgGIkRMx422KCj8Mr46QV5dI1FZS7KpVjKKOhgMP_yFGaDISoxHTxO1beotDT6uxwkhgJQ8ElBJWJr6fJFB7IsHVWIJCoVQtQ5k9chtL4vAfknog0pdUVMJSUNjNk9fCZUK35DFWiove_QU2cmsvk0qnM5LZOknE9TVSKqYlEVfCpEukSeFXKRiMjIAo3P2YyKYN7gHgYT1Gezq0jnPOFEyXLK6ZvGM47VTKRqsRDVPFMZSxOkssHEfRyxdZvI5UNItH2emEb74H8yaa_1pkEc3JF92YXaulw66ba6wWjwnQ-x_wC0Il5p">