False negative in Clang Static Analyzer if an aggregate is initialized with parnthesized list (original) (raw)

Skip to content

Sign in

Appearance settings

View all features

View all solutions

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Sign in

Sign up

Appearance settings

llvm / llvm-project Public

Additional navigation options

New issue

New issue

Closed

#148988

Closed

False negative in Clang Static Analyzer if an aggregate is initialized with parnthesized list

#148875

#148988

Labels

clang:static analyzerfalse-negativeWarning doesn't fire when it should

@necto

Description

@necto

necto

opened

on Jul 15, 2025

C++20 Enabled treatment parenthesized initialization as aggregate initialization
Clang Static Analyzer, however, does not handle it properly:

struct Storage { int x; };

int t1() { Storage w{32}; return 1 / (w.x - 32); // Division by zero reported }

int t2() { Storage w(32); return 1 / (w.x - 32); // False negative }

Metadata

Metadata

Assignees

No one assigned

Labels

clang:static analyzerfalse-negativeWarning doesn't fire when it should

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions