llvm / llvm/llvm-project

[Clang] Missing attribute to diagnose unused variables with certain constructors

Open
#222,655 0 comments 0 reactions 0 assignees View on GitHub
clang:diagnostics enhancement
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

There are some classes (e.g. `std::unique_lock`), which only do something meaningful when certain constructors are used. Others don't do anything and should be diagnosed. Unfortunately, there is currently no equivalent to `[[gnu::warn_unused]]` for individual constructors.

Contributor guide

Open the contributing guide

Research direction

Start by locating the existing implementation of the [[gnu::warn_unused]] attribute and the diagnostics for std::unique_lock. Determine how an equivalent attribute could apply to individual constructors, including which constructors should trigger a warning and which should not. Done means the attribute is supported and the intended constructor-specific diagnostics are covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.