<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/60830>60830</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[libc++] `std::make_shared<T[N]>()` (with no function arguments) may need to be supported in pre-C++20 modes
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
frederick-vs-ja
</td>
</tr>
</table>
<pre>
[N4659 [util.smartptr.shared.create]/1](https://timsong-cpp.github.io/cppwp/n4659/util.smartptr.shared.create#1) (the wording was almost unchanged since N3337) stated that
> _Requires_: The expression `::new (pv) T(std::forward<Args>(args)...)`, where `pv` has type `void*` and points to storage suitable to hold an object of type `T`, shall be well formed. ...
When `T` is a bounded array type and `Args` is empty (but not when `T` is an unbounded array type or `Args` is not empty), `::new (pv) T()` is well-formed if `std::is_default_constructible_v<std::remove_extent_t<T>>` is `true`. It seems to me that implementations should support these cases at least since C++11 (and the behavior is unchanged in C++20).
For `allocate_shared`, the status is not very clear to me. Given [LWG2070](https://cplusplus.github.io/LWG/issue2070) is resolved by [P0674R1](https://wg21.link/p0674r1), it seems that we should also accept cases where `T` is a bounded array type and `Args` is empty in pre-C++20 for `allocate_shared`, and the behavior should be same as that specified by P0674R1.
Currently no implementation support these cases in C++17 or earlier modes ([Godbolt link](https://godbolt.org/z/axsj33aq1)) (some versions of libstdc++ accepted them, which was a [bug](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99006)), so I'm not sure whether my understanding is right.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVc1u27wSfRp6M7AgU5ZsL7yInSgoUBQXRYAuDUoaS2wpUuWQdt2nvxhJcW7a3G_xLRIb9Pyec2ZGEenWIu5FfhD540LF0Dm_P3ts0Ov6x_JCy-9qUbnmxiZf1kW-A5EfYtAmoV75MASfUKc8NkntUQUU-aOQ5Wr82HYhDCSyByFLI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