Skip to content

Print name of uninitialized subobject (instead of type) #58601

@tbaederr

Description

@tbaederr

There is currently a weird diagnostic in clang when a constructor doesn't fully initialize an object:

class Foo {
public:
    int a;
    constexpr Foo(){}
};

constexpr Foo F;

https://godbolt.org/z/5WdT8d4GE

The diagnostics for this example are a little weird. First we note that the subobject is of type 'int' for some reason and then we actually note where the subobject was declared.

I think mentioning the subobject name instead of the type in the original diagnostic would make much more sense.

Metadata

Metadata

Assignees

Labels

clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzergood first issuehttps://github.com/llvm/llvm-project/contribute

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions