Skip to content

Uninitialized data member in test code #1444

Open
@jwakely

Description

https://github.com/oneapi-src/oneTBB/blob/1f52f5093ec7ce23829fe64ab82ac5541fea42ee/test/conformance/conformance_flowgraph.h#L335-L351

If I'm reading this correctly, the copy constructor does not initialize copies_count. That means if you make a copy of a copy, the new object will do ++other.copies_count; on an uninitialized variable.

Is there any reason not to initialize copies_count to zero here?

Using default member initializers for all four data members seems sensible.

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions