<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/62154>62154</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-tidy] performance-noexcept-move-constructor should also flag missing `noexcept` on swap functions and default constructors
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
sweemer
</td>
</tr>
</table>
<pre>
According to C++ Core Guideline [F.6](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rf-noexcept):
> Destructors, swap functions, move operations, and default constructors should never throw. See also [C.44](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rc-default00).
>
> Enforcement
> - Flag functions that are not noexcept, yet cannot throw.
> - Flag throwing swap, move, destructors, and default constructors.
However it looks like the performance-noexcept-move-constructor check only flags missing `noexcept` on move constructors and move assignment operators. It would be good if this check could also flag missing `noexcept` on swap functions and default constructors for consistency with the guideline.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVE1zmzAQ_TXisgMD4iP2gUNsx22v7S8QYgE1QstIIq7_fUeKY8fTptNDLoh5mv147-1KOKdGg9iyesfqQyJWP5Ft3QlxRpt01J_bRynJ9sqM4An2jO8Y38GeLMKXVfWolUFg9e6YNaw-ML6ZvF8cKx8ZPzJ-VI7ksmSj8tPaZYoYP-6XJYRfo93fsfL7kBrCXxIXz_g2ZMwPLH_7lk9wQOftKj1Zx_ge3EksMKxGekUmIjO9INCCVlwhYXrocRCr9iDJXBOAm2jVPRh8QQt-snTK4AciCO0o8NtnVfXZBGV6aSXPGd9mN2a3vyczkJU4o_E3MIWjFuONK_hJeBAWwZCHm2h7OKMHKUyAXzn9kSTCwd0g35to4ezv1f1IuOy9K1_pFPVTHjTRswOtnhH8hLCgHcjOwki8upqGUum7ZCAnlM9ARp9h0GJ0MCvnQnOsya-0mhzIvHp752DoMKKvUx0ku5gf2oRvHk7R4g5hJOpBDeAn5S5FZbyLbofS_6h8P2cfT9QQCJFxynk08gwn5aeoxfg2BFnSt2W_LbciwbZoNkXNm3JTJVMrevGQd8Wm7-tu0w11UZdd_VBt66YoG4FVolqe8zKvijrn5baqMt7IZuBy0xRdhVwOrMpxFkpnWr_MGdkxUc6t2Da8qKtEiw61i2vPucETxEvGeXgFbBti0m4dHatyrZx3tyxeeR3fC6mFGVOv-jOrD__p72XJPlHlZLW6vd_IyypKmhk_hr4vR7pY-onSx6V1a1zLqMbvAAAA___lNbWd">