Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

`A15-4-4`: Query incorrectly alerts functions that raise/can raise exceptions

Aberta
#824 0 comentários 0 reações 1 responsável Ver no GitHub

@rak3-sh já está trabalhando nisso.

Desde 22/12/2024.

Avaliação

Esta issue ainda não foi avaliada.

Descrição

Difficulty-Medium false positive/false negative Impact-Low
Affected rules

A15-4-4

Description
  1. Query doesn’t consider ReThrowExpr. E.g. the query says to mark rethrow() below as noexcept
Example
template <bool DoRethrow>
void rethrow() {
  throw;
}

int main()
{
  rethrow<true>();
  return 0;
}
  1. The query doesn’t check for throw expressions that occur inside lambdas defined in a function. E.g.
Example
void func()  {
    std::call_once(init_flag_, [this] {
      if (sem_init(&sem_, 0, 0) != 0) {
        throw std::system_error(errno, std::system_category()); // Throw in a lambda.
      }
      initialized_ = true;
    });
  }
  1. In some cases the noexcept specification is a complex condition involving several logical operations or template instantiations. In such a case, CodeQL’s check for whether its noexcept(true) or noexcept explicitly false doesn’t work and it alerts that it can be marked as noexcept. For practical reasons, maybe we can consider a noexcept(expr) as being marked by the user as correct.
Linguagem predominante
CodeQL
Estrelas
227
Forks
82
Merge médio
6d 7h
PRs com merge (30d)
9

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de github/codeql-coding-standards

Todas as issues de github/codeql-coding-standards

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.