Skip to content

Commit e8d8cc7

Browse files
committed
fix
1 parent 1644863 commit e8d8cc7

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

lib/suppressions.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,30 @@ std::vector<SuppressionList::Suppression> SuppressionList::parseMultiSuppressCom
207207
suppressions.push_back(std::move(s));
208208
}
209209

210+
std::string::size_type extraPos = comment.find(';', end_position);
211+
std::size_t delimSize = 1;
212+
213+
if (extraPos == std::string::npos) {
214+
extraPos = comment.find("//", end_position);
215+
delimSize = 2;
216+
}
217+
218+
if (extraPos == std::string::npos)
219+
return suppressions;
220+
221+
std::string extraComment = comment.substr(extraPos + delimSize);
222+
223+
if (extraComment.size() >= 2 && extraComment.compare(extraComment.size() - 2, 2, "*/") == 0)
224+
extraComment.erase(extraComment.size() - 2, 2);
225+
226+
extraComment = trim(extraComment);
227+
228+
for (auto it = extraComment.begin(); it != extraComment.end();)
229+
it = *it & 0x80 ? extraComment.erase(it) : it + 1;
230+
231+
for (auto &suppression : suppressions)
232+
suppression.extraComment = extraComment;
233+
210234
return suppressions;
211235
}
212236

0 commit comments

Comments
 (0)