llvm / llvm/llvm-project

[analyzer] False negatives of uninitialized variables in C++ for record types after self-assignment initialization

Open
#209,708 1 comment 0 reactions 0 assignees View on GitHub
clang:static analyzer false-negative
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Continuing #187530 for the false negatives detected in the test cases.

1. Unions in C++
https://github.com/llvm/llvm-project/blob/4aa1590ad66a1bff9b3c74b4a2c7366473015b4c/clang/test/Analysis/issue-173210-self-assign-init.c#L48-L55

2. Self-assignment in default member initializer
https://github.com/llvm/llvm-project/blob/4aa1590ad66a1bff9b3c74b4a2c7366473015b4c/clang/test/Analysis/issue-173210-self-assign-init.c#L68-L74

We can discuss here whether the analyzer should report them.

Contributor guide

Open the contributing guide

Research direction

Start with clang/test/Analysis/issue-173210-self-assign-init.c, especially lines 48-55 and 68-74, and compare the existing analyzer behavior with issue #187530. Determine whether unions and self-assignment in default member initializers should produce diagnostics, then confirm the expected behavior with maintainers. Done means the decision is recorded and the relevant regression coverage and analyzer behavior agree.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.