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

    <tr>
        <th>Summary</th>
        <td>
            make_unique cannot create struct of size of 0 due to default_delete's static_assert failure
        </td>
    </tr>

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

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

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

<pre>
    See code in compiler explorer: https://www.godbolt.org/z/z8xf31bG4

struct of size of 0 does have its usage and it is supported by GNU C (https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html). However, make_unique makes it impossible to create such an unique_ptr because its default_delete requires "A" must have non-zero size.

struct A{
alignas(int[0]) int ptr[0];
};
void test(){
        unique_ptr<A> ptr=make_unique<A>();
}

 error: static assertion failed: can't delete pointer to incomplete type
   83 |         static_assert(sizeof(_Tp)>0,
      |                       ~~~~~~~~~~~^~


I am not arguing that static_assert is reasonable. My point is that "make_shared" can actually deal this properly. i.e.
shared_ptr ptr=make_shared<A>();
gives no error at all.

p.s. I just realized that it is rather a library issue than a parser one as clang is directly using this library. Does clang plan to fix this library apart from GCC? 
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyFVE1z2zYQ_TXUZcccmJQi6cCDIztuZtpe2l560YDgkkQCAQw-ZMu_vo-kFEsZz1RDgSCwu3j79i1q15yqv5hJuYZJW7wPgzbsiV8H4zz7rHygPsYhYJIVX_C8vLzknWtqZ2LufIeVt_G_eW3L-_p5mYnHTDzMY4g-qUiupaDfeHwLahwH6uURx8VAKciOSdoGX6QDhTQMzkduqD7R85__0I6yYnMLoFMq72w6H-6s0ZYbp8K8hfFf9u7ud7Zd7PM-HkxWbHP6zb3wEfkUOzrI77xPVv9IPM3DdPhhcCHo2jBFR8qzjAw4qgc6mo33Q_RUs5IpzOgbbmUycd-wYVh7_pG0R7isKI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