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

    <tr>
        <th>Summary</th>
        <td>
            What happened to [[no_unique_address]] ? Deadlock occured!
        </td>
    </tr>

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

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

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

<pre>
    On windows its not working, clang17 outputs
```cpp
warning: unknown attribute 'no_unique_address' ignored [-Wunknown-attributes]
```
https://github.com/llvm/llvm-project/issues/49358

I read and it also does not solve problem, even when i add flag `-fms-compatibility` (rly i dont want FULL compatibility with non-standard compatible msvc for one standard attribute!!!)
```cpp
struct E {};
struct A {
  char c;
  [[msvc::no_unique_address]] E val;
};

int main() { static_assert(sizeof(A) == 1); }
```
Output:
```
PS C:\Users\User> clang++ ./test.cpp -std=c++20 -fms-compatibility 
./test.cpp:4:5: warning: unknown attribute 'no_unique_address' ignored [-Wunknown-attributes]
    4 |   [[msvc::no_unique_address]] E val;
 |     ^~~~~~~~~~~~~~~~~~~~~~~
./test.cpp:7:28: error: static assertion failed due to requirement 'sizeof(A) == 1'
    7 | int main() { static_assert(sizeof(A) == 1); }
      | ^~~~~~~~~~~~~~
./test.cpp:7:38: note: expression evaluates to '2 == 1'
 7 | int main() { static_assert(sizeof(A) == 1); }
      | ~~~~~~~~~~^~~~
```

Same output for just [[no_unique_address]], so, now i see deadlock in those conversations, while clang waits for msvc support and some abi smart things, msvc waits CLANG to support [[no_unique_address]] (i dont know why)
https://github.com/microsoft/STL/issues/1364#issuecomment-1034167093

![image](https://github.com/llvm/llvm-project/assets/58717435/879fd289-401b-4383-a78f-e004d372c6df)

(its really deadlock)

I will not comment on the decision of MSVC to add its own attribute [[msvc::no_unique_address]] after [[no_unique_address]] was standartized, but it is obvious that the longer it is delayed, the more code will be affected by the so-called ABI breakdown, because people use this attribute all over the place, but it doesn't work right now

In any case, I do not consider adjusting to the MSVC policy to be the correct strategy, especially since due to this strategy, now clang is the only compiler on which it is impossible to use this attribute. On GCC it just works, on MSVC you can write [[msvc::no_unique_address]] and on clang ?? there are no way!



</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0Vs2O47gRfhr6UnBDIiVLPvjgn_GigU4mQGezxwFFlixuU6SWpKx4D3n2gJTb45npnmQXO40GbZNVZH3181Vx79XJIG5IuSPlYcHH0Fm3eUHdWLNorLxsPhqYlJF28qCCB2MDTNa9KHMidA9Cc3PKK7BjGMbgSXYg2ZassvlfDMO8M3FnogbbwmhejJ0M8BCcasaAQGhl7KfRqN9G_MSldOg9oRWok7EOJZByt_zlqra8qXlSHr56bv7ZhTB4wraEHgk9nlToxuZB2J7Qo9bn14_l4OyvKAKhR-X9iJ7QY7FmZX29M62P4JBL4EaCCsC1tyAtzk7wVp8RBmcbjX10BZ7RwNShAQVcSmg1PwFZZcu290th-4EH1SitwoWsMiC0dvoCCqQ1ASZuAhx_fnqCLwRhUqEDY83SB24kd_J2rhF6fxbQWgfWINwEbg4iNH_9X78XFx_cKAJ8AFLtSHUgbPfF_jbtpx0A0XEH4iYCkHJmF62I3mbbb4NYHkh5gA9w5vqmd__MvCoToOfKEFoTuo5PRjRBiU_ce3SB0Nqr39G2hNbbJMEOhB0gAWM7iDe-lQgfU05G2946_ccz7ONZuf_Zo_PXT8I-zDlN6I7QHTwQegzow4MYBlj6IAk7iPmMZvBtaGG-_F6NsG1B2LaMyf9D6wAAoABS7eHPxuaqHNU__OfNvzfhVYRtaR1BoXPWxS9zAGEOoLIGWq40SpAjQrDg8LdROezRhAj7vfBWn4FVyba_LFVghlntv4H6LkKWEBobMCH99xDdGKHhmeuRB_QRGaEVfQPBDzP_zvAE5M1cn9dn3uOVqBNt_Dr6cE2Ud9Ij0pq3cTV2AgUeESRyqa14AWUgdNYjCGvO6DyPcfZReOqUxrmMYOKxa8TnE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