Skip to content

C++ false positive: return statement requested after a call to a [[noreturn]] function #3327

Open
@lhmouse

Description

@lhmouse

Synopsis

See references below for code.

The macro ASTERIA_THROW() [2] expands to a call to ::rocket::sprintf_and_throw<::std::runtime_error>() [3], which is marked [[noreturn]], so the enclosing function cannot return from this path; a return statement is unnecessary.

References

  1. Original alert: https://lgtm.com/projects/g/lhmouse/asteria/snapshot/125fa22efeb5dd86142984195bc51adbddcd6c5e/files/asteria/src/library/json.cpp#xfc14c5368f329856:1
  2. ASTERIA_THROW: https://lgtm.com/projects/g/lhmouse/asteria/snapshot/125fa22efeb5dd86142984195bc51adbddcd6c5e/files/asteria/src/utilities.hpp?sort=name&dir=ASC&mode=heatmap#x3cb8f8cc1a4b1672:1
  3. ::rocket::sprintf_and_throw<::std::runtime_error>: https://lgtm.com/projects/g/lhmouse/asteria/snapshot/125fa22efeb5dd86142984195bc51adbddcd6c5e/files/asteria/rocket/throw.hpp?sort=name&dir=ASC&mode=heatmap#L16

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions