This is an archive of the discontinued LLVM Phabricator instance.

[Clang-tidy] Fix readability-static-definition-in-anonymous-namespace warnings; other minor fixes.
AbandonedPublic

Authored by Eugene.Zelenko on Apr 5 2016, 5:20 PM.

Details

Summary

Some Include What You Use suggestions were used too.

I checked this patch on my own build on RHEL 6. Regressions were OK.

Diff Detail

Event Timeline

Eugene.Zelenko retitled this revision from to [Clang-tidy] Fix readability-static-definition-in-anonymous-namespace warnings; other minor fixes..
Eugene.Zelenko updated this object.
Eugene.Zelenko set the repository for this revision to rL LLVM.
Eugene.Zelenko added a subscriber: cfe-commits.
alexfh edited edge metadata.Apr 7 2016, 6:43 AM

Please regenerate the patch with the full context.

clang-tidy/ClangTidy.cpp
39

Did you make these changes automatically or use IWYU or a similar tool?

58

Please also make it const char *const or even better const char X[] = .

clang-tidy/misc/DanglingHandleCheck.cpp
32

I'd prefer this to remain StringRef &. The type name is short and it's good to be able to see that it's not std::string &, for example.

alexfh requested changes to this revision.Apr 7 2016, 6:43 AM
alexfh edited edge metadata.
This revision now requires changes to proceed.Apr 7 2016, 6:43 AM

Actually, removal of static is not the right thing for LLVM:

Because of this, we have a simple guideline: make anonymous namespaces as small as possible, and only use them for class declarations.

http://llvm.org/docs/CodingStandards.html#anonymous-namespaces

Eugene.Zelenko abandoned this revision.Apr 7 2016, 11:37 AM