This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Address false positive in modernize-use-default-member-init
ClosedPublic

Authored by njames93 on Apr 1 2020, 1:36 AM.

Diff Detail

Event Timeline

njames93 created this revision.Apr 1 2020, 1:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 1 2020, 1:36 AM
aaron.ballman accepted this revision.Apr 3 2020, 9:35 AM

LGTM with a testing request.

clang-tools-extra/test/clang-tidy/checkers/modernize-use-default-member-init.cpp
436

Can you add a test where the value is elided but braced init is still used:

struct PR45363 {
  PR45363() : m_i{} {} // This should still warn
  int m_i;
};
This revision is now accepted and ready to land.Apr 3 2020, 9:35 AM
njames93 updated this revision to Diff 254870.Apr 3 2020, 11:41 AM
  • Added test case
This revision was automatically updated to reflect the committed changes.