This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Support initializer_list in google-explicit-constructor check
ClosedPublic

Authored by alexfh on Nov 26 2014, 5:10 PM.

Details

Summary

According to the Google C++ Style Guide, constructors taking a single
std::initializer_list<> should not be marked explicit.

This change also changes the messages according to conventions used in Clang
diagnostics: no capitalization of the first letter, no trailing dot.

Diff Detail

Event Timeline

alexfh updated this revision to Diff 16666.Nov 26 2014, 5:10 PM
alexfh retitled this revision from to [clang-tidy] Support initializer_list in google-explicit-constructor check.
alexfh updated this object.
alexfh edited the test plan for this revision. (Show Details)
alexfh added a reviewer: djasper.
alexfh added a subscriber: Unknown Object (MLST).
djasper accepted this revision.Nov 27 2014, 1:39 AM
djasper edited edge metadata.

Looks good.

clang-tidy/google/ExplicitConstructorCheck.cpp
93

Maybe make this call for action more, e.g. "%0 constructor must not be declared explicit".

This revision is now accepted and ready to land.Nov 27 2014, 1:39 AM
alexfh closed this revision.Nov 27 2014, 3:12 AM
alexfh added inline comments.Nov 27 2014, 3:13 AM
clang-tidy/google/ExplicitConstructorCheck.cpp
93

Changed the message to "X should not be declared explicit" to match the Style Guide wording.