Skip to content

A15-4-4: Functions that allocate are considered non-throwing #662

Open
@gg-sr

Description

@gg-sr

Affected rules

  • A15-4-4

Description

A15-4-4/MissingNoExcept.ql flags functions which are not noexcept when no exception is explicitly thrown by them (or the functions they call). Unfortunately, this doesn't take into a account the fact that std::bad_alloc can be implicitly thrown by functions which allocate.

Example

void AppendTo(std::string& string) {
  // rules/A15-4-4/MissingNoExcept.bqrs:
  //   Function AppendTo could be declared noexcept(true).
  static_cast<void>(string.append("foo"));
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Difficulty-MediumA false positive or false negative report which is expected to take 1-5 days effort to addressImpact-MediumStandard-AUTOSARfalse positive/false negativeAn issue related to observed false positives or false negatives.user-reportIssue reported by an end user of CodeQL Coding Standards

    Type

    No type

    Projects

    Status

    Triaged

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions