Commit ada08fc
committed
st: fix CI - Expected analyzer false positive via std::get_if
clang-analyzer (LLVM 18 + libstdc++) cannot model the std::variant
discriminant through std::get<1>, so it treats the Error returned by
Expected::error() as having an uninitialized `result` field and flags
every Error copy/move that originates from it (reported at Result.h:107,
the Error copy/move ctor). std::get_if<1> - already used without
complaint by operator-> - returns a pointer the analyzer models as
defined, so error() now reads through it, and value() routes through
error() instead of raw std::get<1>. get_if also better fits the noexcept
accessor (std::get can throw bad_variant_access).
Revert the ineffective `Result result{}` default-init in the classic
Result.h header (the analyzer flags the copy, not default construction;
the real fix is above), restoring that header to pristine. Suppress an
unrelated NewDeleteLeaks false positive on a move-only mapper in
FutureTest.1 parent c11e919 commit ada08fc
3 files changed
Lines changed: 11 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
| 135 | + | |
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
174 | 174 | | |
175 | | - | |
| 175 | + | |
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
134 | 138 | | |
135 | 139 | | |
| 140 | + | |
136 | 141 | | |
137 | 142 | | |
138 | 143 | | |
| |||
0 commit comments