<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/69046>69046</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang/tools/clang-fuzzer/proto-to-cxx/loop_proto_to_cxx.cpp:51: possible missing default in switch ?
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
dcb314
</td>
</tr>
</table>
<pre>
Static analyser cppcheck says:
clang/tools/clang-fuzzer/proto-to-cxx/loop_proto_to_cxx.cpp:51:20: error: Found an exit path from function with non-void return type that has missing return statement [missingReturn]
Source code is
td::ostream &operator<<(std::ostream &os, const VarRef &x) {
std::string which_loop = inner_loop ? "j" : "i";
switch (x.arr()) {
case VarRef::ARR_A:
return os << "a[" << which_loop << "]";
case VarRef::ARR_B:
return os << "b[" << which_loop << "]";
case VarRef::ARR_C:
return os << "c[" << which_loop << "]";
}
}
Suggest add default to switch or return statement at end of function.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVNGuozYQ_ZrhZZSI2JCEBx6SG_EBWamvkbEH8JbYyB7uTfbrK0hIN2orrapFCLBnmHPm-NgqRts6ohLyI-SnRI3c-VAaXctNltTe3MtvrNhqVE7190gB9TDojvSfGNU9gjxAeoL0-dS9ci2Iir3vI4hqHq-a8ccPCiCqIXj2K_YrfbuBqHrvh8s8d2F_0bfbWg8DyEO-AXkQKcgDUgg-TB-VH51B5ZBulnFQ3GET_BWb0Wm23uGX5Q6dd6tPbw0G4jE45PtAyJ1i7FTEq43RunYJRlZMV3KMkB-fsfMcgvz0c1ff_Bg0ofaG0MafI2wmAeTBRw6krghi6wcKiifSH9Mt9vHfkiKID9TeRcY_VDhTM83eQBQIu-OjNr5-jBwm2l-d1d1lEg1BntA6R2EZVghCfAchcBILhLAgBMilFMYvy7pDEPvbWoUAYg-ieIdDRK0iPfk8kA_n8-XwWmOcr6d6PuKjxQlNTfaZweeZN6ZLziTqG6f_wDv-Al79G_E-fgFP_x882C0u2r3baWxbiozKGDTUqLFnZL8skQ__9KdiJGfQNy-7rx-lElNKU8hCJVRutsVO7EQms6Qrt0plSudFbjJNW9o3ojZU60LvUllkGSW2FKmQm3STpXsp82xdk2n2TSGaLDONLGrIUroq26_7_vO69qFNbIwjldsizbZJr2rqY_mQ5bnrJwWSUE75q3psI2RpbyPHvyuw5Z7K33hI4OBjtHVPr729CGrdy_OySsbQlx3zMJ9XogJRtZa7sV5rf50w-s_ltRqC_06aQVRzvxPBueW_AgAA__8GrpCm">